<template>
  <div class="page_root" :key="queryUpdateFlag" data-page-name="工作台1.0" data-page-identification="c_upgf3pcjfa">
    <a-spin :spinning="pageLoading.loading" :tip="pageLoading.tip">
      <!-- begin vid_3jhvgk4byc 自定义模板_o7c8iu8hjy -->
      <!--                  培训考试-->
      <a-modal :visible="pxState.videoVisble" width="885px" centered title="视频文件" @cancel="closeVideo" destroy-on-close :footer="null">
        <div class="video-container">
          <video id="video01" :src="pxState.videoSrc" playsinline webkit-playsinline preload="auto" autoplay width="840" height="360"></video>
          <!--                    <div class="watermark"></div>-->
        </div>
      </a-modal>
      <a-modal v-model:visible="pxState.visible" centered @cancel="pxState.visible = false" :footer="null" width="80%" :title="pxState.title">
        <div class="px-table-body">
          <div class="px-default-table">
            <a-table
              bordered
              :columns="filteredPxksColumns"
              :data-source="pxState.dataSource"
              @resizeColumn="handleTaskResizeColumn"
              :pagination="false"
              :loading="pxState.pxTableLoading"
              :scroll="{ x: 'max-content', y: 650 }"
            >
              <template #bodyCell="{ column, record, text }">
                <template v-if="column.dataIndex === 'file'">
                  <div class="file-div" v-for="(item, index) in record.fileList">
                    <a-dropdown>
                      <span
                        style="
                                                    overflow: hidden;
                                                    white-space: nowrap;
                                                    text-overflow: ellipsis;
                                                    display: block;
                                                "
                        :title="item.name"
                      >
                        {{ item.name }}
                      </span>
                      <template #overlay>
                        <a-menu>
                          <a-menu-item v-if="isVideo(item.type)">
                            <a-button style="width: 100%" type="link" size="small" @click="showVideo(item.url)">预览</a-button>
                          </a-menu-item>
                          <a-menu-item>
                            <a-button style="width: 100%" type="link" size="small" @click="handlerDownload(item)">下载</a-button>
                          </a-menu-item>
                        </a-menu>
                      </template>
                    </a-dropdown>
                  </div>
                </template>
                <template v-if="column.dataIndex === 'videoName'">
                  <template v-if="record.videoList.length > 0">
                    <div v-for="(item, index) in record.videoList" @click="showVideo(item.videoLinks)" class="videolinks">
                      {{ item.videoName?.trim() }}
                    </div>
                  </template>
                  <!--                                    <div class="video-name" @click="showVideo(record.videoLinks)"> {{ text }}</div>-->
                </template>
                <template v-if="column.dataIndex === 'examLink'">
                  <template v-if="text">
                    <div v-for="(item, index) in handlerGetSpace(text)">
                      <a :key="index" :href="item.trim()" style="display: block" rel="noopener noreferrer" target="_blank">{{ item?.trim() }}</a>
                    </div>
                  </template>
                </template>
                <template v-if="column.dataIndex === 'description'">
                  <template v-if="text">
                    <div v-for="(item, index) in handlerGetSpace1(text)">
                      {{ item?.trim() }}
                    </div>
                  </template>
                </template>
              </template>
            </a-table>
          </div>
        </div>
      </a-modal>
      <!--                  培训考试-->
      <!--FAQ-->
      <a-modal :visible="faqVisible" title="FAQ" width="80%" :footer="null" centered @cancel="faqVisibleCancel">
        <a-table :columns="faqColumns" :data-source="faqDataSource" bordered :scroll="{ y: 630 }" :pagination="false"> </a-table>
      </a-modal>
      <!--FAQ-->
      <!--      完整-->
      <a-modal v-model:visible="newState.showVisible" :title="newState.newTitle" centered :footer="null">
        <div class="total-msg">{{newState.content}}</div>
      </a-modal>
      <!--      完整-->
      <!-- 新-模板项目检查清单弹出框 -->
      <a-modal :visible="ptTemplateState.okMbVisible" title="完成平台模板任务" destroyOnClose centered width="40%" :getContainer="getModalContainer" @cancel="ptTemplateState.okMbVisible = false">
        <div style="border-bottom:1px solid #d9d9d9;margin-bottom:10px;" v-if="ptTemplateState.ppmTemplateCheckList.length>0||ptTemplateState.sopList[0].contentList.length>0">
          <!-- 完成标准 -->
          <div class="new-check" v-if="ptTemplateState.ppmTemplateCheckList.length>0">
            <div class="label">审核标准</div>
          </div>
          <div class="checkbox-group" v-for="(item,index) in ptTemplateState.ppmTemplateCheckList" :key="index">
            <a-checkbox v-model:checked="item.selected">
              {{ item.content }}
            </a-checkbox>
          </div>
          <!--                        sop-->
          <div class="new-check" v-if="ptTemplateState.sopList[0].contentList.length>0">
            <div class="label">SOP</div>
          </div>
          <div class="checkbox-group">
            <a-checkbox v-for="(msg,index) in ptTemplateState.sopList[0].contentList" :key="index" v-model:checked="msg.selected">
              {{msg.msg}}
            </a-checkbox>
          </div>
          <!--                        sop-->
        </div>

        <template #footer>
          <a-button key="back" type="primary" @click="downLoadPtMbTemplate">下载模板</a-button>
          <a-button key="back" @click="ptTemplateState.okMbVisible = false">取消</a-button>
          <a-button key="back" @click="handleSubmitPtSop">暂存SOP</a-button>
          <a-button key="submit" type="primary" :loading="templateOkDisabled" @click="handlerPtMbTemplateOk">提交审批</a-button>
        </template>
        <a-spin :spinning="uploadingPt" tip="附件上传中...">
          <a-upload :file-list="ptTemplateState.fileList" :multiple="true" :before-upload="handlerUploadWc" @remove="handleRemoveWc" accept=".xlsx,.ppt,.pdf,.PDF, image/*, .docx, .rp, .xls">
            <a-button type="primary">
              <upload-outlined />
              上传
            </a-button>
          </a-upload>
          <span>支持格式：image/*,.xlsx,.xls,.docx,.rp,.ppt,.pptx,.pdf</span>
        </a-spin>
      </a-modal>
      <!-- 模板项目检查清单弹出框 -->
      <!--审批详情-->
      <a-modal @cancel="statuState.visible = false" centered :visible="statuState.visible" title="审批详情" :footer="null" :body-style="{maxHeight:'700px',overflowY:'auto'}" width="400px">
        <div class="status-item" v-for="(item, index) in statuState.list">
          <div class="title-new-status">
            <div class="left-title"
              >审批类型:<span class="weight-status-new">{{ item.processName }} </span></div
            >
            <div class="right-title"
              >审批提交时间:<span class="weight-status-new">{{ item.createdDate }} </span></div
            >
          </div>
          <a-steps class="status-step" direction="vertical">
            <a-step
              v-for="(inside, index) in item.processTaskList"
              :title="inside.nodeMessage"
              :description="inside.taskName + ':' + inside.assignUserName"
              :status="getIconStatus(inside.nodeStatus)"
            />
          </a-steps>
        </div>
      </a-modal>

      <!--审批详情-->
      <a-modal :visible="scoreState.visible" title="加减分详情" :footer="null" width="1000px" @cancel="scoreState.visible = false">
        <div class="score-title-first"> <ExclamationCircleOutlined style="color:orange;margin-right:8px" />已结算的任务不支持通过编辑修改是否扣分，请联系相关领导通过员工绩效页面做修正加减分处理 </div>
        <div class="score-table" v-if="scoreState.type === '项目总监'">
          <div class="score-title"
            >项目总监加减分总和：<span :class="[ calculateTotalTaskPoints(scoreState.scoreData)>=0 ? 'score-num' : 'score-num-red']">{{ calculateTotalTaskPoints(scoreState.scoreData) }}</span>
          </div>

          <div v-for="(item,index) in scoreState.scoreData" :key="index" style="margin-bottom:17px">
            <div class="score-month"
              >{{item.month}}月绩效结算明细
              <span class="month-score"
                >月度加减分总和：<span class="default-score">{{getScore(item.data)}}</span></span
              >
            </div>
            <a-table :scroll="{ x: '700px', y: '200px' }" :columns="labelCoulmn" :dataSource="item.data" bordered :pagination="false" />
          </div>
        </div>
        <div class="score-table" v-if="scoreState.type === '项目经理'">
          <div class="score-title"
            >项目经理加减分总和：<span :class="[ calculateTotalTaskPoints(scoreState.scoreData)>=0 ? 'score-num' : 'score-num-red']">{{ calculateTotalTaskPoints(scoreState.scoreData) }}</span>
          </div>
          <div v-for="(item,index) in scoreState.scoreData" :key="index" style="margin-bottom:17px">
            <div class="score-month"
              >{{item.month}}月绩效结算明细
              <span class="month-score"
                >月度加减分总和：<span class="default-score">{{getScore(item.data)}}</span></span
              >
            </div>
            <a-table :scroll="{ x: '700px', y: '200px' }" :columns="labelCoulmn" :dataSource="item.data" bordered :pagination="false" />
          </div>
        </div>
        <div class="score-table" v-if="scoreState.type === '负责人'">
          <div class="score-title"
            >项目负责人和任务执行人加减分总和：<span
              :class="[ calculateTotalTaskPoints(scoreState.scoreData)>=0 ? 'score-num' : 'score-num-red']"
              >{{ calculateTotalTaskPoints(scoreState.scoreData) }}</span
            >
          </div>
          <div v-for="(item,index) in scoreState.scoreData" :key="index" style="margin-bottom:17px">
            <div class="score-month"
              >{{item.month}}月绩效结算明细
              <span class="month-score"
                >月度加减分总和：<span class="default-score">{{getScore(item.data)}}</span></span
              >
            </div>
            <a-table :scroll="{ x: '700px', y: '200px' }" :columns="labelCoulmn" :dataSource="item.data" bordered :pagination="false" />
          </div>
        </div>
      </a-modal>
      <!--          编辑行动项任务-->
      <a-modal
        :visible="actionState.addOrEditActionVisible"
        :title="actionState.title"
        destroyOnClose
        centered
        width="50%"
        :ok-button-props="{ loading: okLoading }"
        :body-style="{ maxHeight: '850px', overflow: 'auto' }"
        @cancel="actionStateCancel"
        @ok="handleSubmitAction"
        :maskClosable="false"
      >
        <a-form ref="actionFormRef" :model="actionState.actionList">
          <div v-for="(item, index) in actionState.actionList" :key="index" class="form-item">
            <div class="form-content-action">
              <a-row>
                <a-col :span="12">
                  <a-form-item
                    label="工厂/项目名称"
                    :name="[index, 'projectName']"
                    :rules="[
                                                    { required: true, message: '请选择工厂/项目名称!', trigger: 'blur' }
                                                ]"
                  >
                    <a-tree-select
                      v-model:value="actionState.actionList[index].projectName"
                      show-search
                      style="width: 100%"
                      placeholder="请选择"
                      allow-clear
                      :tree-data="actionState.treeData"
                      :fieldNames="{
                                                        children: 'children',
                                                        label: 'projectName',
                                                        value: 'projectId',
                                                        key: 'projectId'
                                                    }"
                      @change="treeChange"
                      :max-tag-count="1"
                    />
                  </a-form-item>
                </a-col>
                <a-col :span="12">
                  <a-form-item label="行动项任务名称" :name="[index, 'actionTaskName']" :rules="{ required: true, message: '请输入行动项任务名称!' }">
                    <a-input placeholder="请输入行动项任务名称" v-model:value="actionState.actionList[index].actionTaskName" />
                  </a-form-item>
                </a-col>
              </a-row>
              <a-row v-if="actionState.isproject">
                <a-col :span="12">
                  <a-form-item label="项目阶段">
                    <a-select
                      allow-clear
                      placeholder="请选择项目阶段"
                      v-model:value="actionState.actionList[index].milepostId"
                      :field-names="{ label: 'milepostName', value: 'milepostId' }"
                      :filter-option="
                                                        (input, option) => {
                                                            return (
                                                                option.milepostName
                                                                    .toLowerCase()
                                                                    .indexOf(input.toLowerCase()) >= 0
                                                            )
                                                        }
                                                    "
                      :options="actionState.milepostList"
                      showSearch
                      @change="actionMchange(index)"
                    />
                  </a-form-item>
                </a-col>
                <a-col :span="12">
                  <a-form-item label="任务名称">
                    <a-select
                      allow-clear
                      placeholder="请选择任务名称"
                      v-model:value="actionState.actionList[index].taskId"
                      :field-names="{ label: 'taskName', value: 'taskId' }"
                      :filter-option="
                                                        (input, option) => {
                                                            return (
                                                                option.taskName
                                                                    .toLowerCase()
                                                                    .indexOf(input.toLowerCase()) >= 0
                                                            )
                                                        }
                                                    "
                      :options="actionState.taskList"
                      showSearch
                      @focus="getActionTask(actionState.actionList[index].milepostId)"
                    />
                  </a-form-item>
                </a-col>
              </a-row>

              <a-row>
                <a-col :span="12">
                  <a-form-item label="任务起止时间" :name="[index, 'allTime']" :rules="{ required: true, message: '请选择任务起止时间!' }">
                    <a-range-picker style="width: 100%" v-model:value="actionState.actionList[index].allTime" valueFormat="YYYY-MM-DD" />
                  </a-form-item>
                </a-col>
                <a-col :span="12">
                  <a-form-item label="任务负责人" :name="[index, 'taskOwner']" :rules="{ required: true, message: '请选择任务负责人!' }">
                    <a-select
                      placeholder="请选择任务负责人"
                      v-model:value="actionState.actionList[index].taskOwner"
                      showSearch
                      :options="peopleList"
                      :field-names="{ label: 'label', value: 'value' }"
                      :filter-option="
                                                        (input, option) => {
                                                            return (
                                                                option.label
                                                                    .toLowerCase()
                                                                    .indexOf(input.toLowerCase()) >= 0
                                                            )
                                                        }
                                                    "
                    />
                  </a-form-item>
                </a-col>
              </a-row>
              <a-row>
                <a-col :span="12">
                  <a-form-item label="审核员" :name="[index, 'assessorName']" :rules="{ required: true, message: '请选择审核员!' }">
                    <a-select
                      placeholder="请选择审核员"
                      v-model:value="actionState.actionList[index].assessorName"
                      showSearch
                      :options="peopleList"
                      :field-names="{ label: 'label', value: 'value' }"
                      :filter-option="
                                                        (input, option) => {
                                                            return (
                                                                option.label
                                                                    .toLowerCase()
                                                                    .indexOf(input.toLowerCase()) >= 0
                                                            )
                                                        }
                                                    "
                    />
                  </a-form-item>
                </a-col>
                <a-col :span="12">
                  <a-form-item label="PMO" :name="[index, 'projectManagementOffice']" :rules="{ required: true, message: '请选择PMO!' }">
                    <a-select
                      placeholder="请选择PMO"
                      v-model:value="
                                                        actionState.actionList[index].projectManagementOffice
                                                    "
                      showSearch
                      :options="peopleList"
                      :field-names="{ label: 'label', value: 'value' }"
                      :filter-option="
                                                        (input, option) => {
                                                            return (
                                                                option.label
                                                                    .toLowerCase()
                                                                    .indexOf(input.toLowerCase()) >= 0
                                                            )
                                                        }
                                                    "
                    />
                  </a-form-item>
                </a-col>
              </a-row>
              <a-row class="one-line">
                <a-col :span="24">
                  <a-form-item label="任务执行人" :name="[index, 'taskParticipantList']" :rules="{ required: true, message: '请选择任务执行人!' }">
                    <a-select
                      placeholder="请选择任务执行人"
                      v-model:value="actionState.actionList[index].taskParticipantList"
                      showSearch
                      mode="multiple"
                      :options="peopleList"
                      :field-names="{ label: 'label', value: 'value' }"
                      :filter-option="
                                                        (input, option) => {
                                                            return (
                                                                option.label
                                                                    .toLowerCase()
                                                                    .indexOf(input.toLowerCase()) >= 0
                                                            )
                                                        }
                                                    "
                    />
                  </a-form-item>
                </a-col>
                <a-col v-if="taskPeopleList && taskPeopleList.length > 0">
                  <div style="width: 700px; margin-left: 115px; margin-bottom: 28px">
                    <a href="javascript:;" v-for="(item, num) in taskPeopleList" @click="handlerAddActionPeople(item.value, index)"
                      ><span style="margin: 0 5px">{{ item.value }}</span></a
                    >
                  </div>
                </a-col>
              </a-row>
              <a-row class="one-line">
                <a-col :span="24">
                  <a-form-item :wrapper-col="{ span: 24 }" name="finishStandard" label="完成标准">
                    <a-textarea :maxlength="1000" :rows="3" v-model:value="actionState.actionList[index].finishStandard" placeholder="请输入" />
                  </a-form-item>
                  <div class="finish-tips" style="margin-top: -4px">
                    请用”；“号区分不同细项的内容，格式参考：<br />
                    1）设计反讲机制及频率、并执行；<br />
                    2）通过反讲，确认研发、产品、测试和现场项目人员等各角色均已对产品设计形成统一认知；
                  </div>
                </a-col>
              </a-row>
              <a-row class="one-line">
                <a-col :span="24">
                  <a-form-item label="备注">
                    <a-textarea placeholder="请输入备注" v-model:value="actionState.actionList[index].description" />
                  </a-form-item>
                </a-col>
              </a-row>
              <a-row class="one-line" v-if="actionState.title === '编辑行动项任务'">
                <a-col :span="24">
                  <a-form-item label="变更原因" :rules="{ required: true, message: '请输入变更原因!', trigger: 'blur' }" :name="[index, 'reasonsChange']">
                    <a-textarea placeholder="请输入变更原因" v-model:value="actionState.actionList[index].reasonsChange" />
                  </a-form-item>
                </a-col>
              </a-row>
            </div>
            <!--                            <a-->
            <!--                                v-if="!actionState.current.actionTaskId && actionState.isTaskAdd === false"-->
            <!--                                class="del"-->
            <!--                                @click="handlerDeleteActionItem(index)"-->
            <!--                                >删除</a-->
            <!--                            >-->
          </div>
        </a-form>
        <!--                    <a-button-->
        <!--                        v-if="!actionState.current.actionTaskId && actionState.isTaskAdd === false"-->
        <!--                        type="primary"-->
        <!--                        ghost-->
        <!--                        class="add-btn"-->
        <!--                        @click="handlerAddActionItem"-->
        <!--                    >-->
        <!--                        <plus-outlined />-->
        <!--                        添加-->
        <!--                    </a-button>-->
      </a-modal>
      <!--          编辑行动项任务-->
      <a-spin :spinning="pageLoadingG.loading" :tip="pageLoadingG.tip">
        <div class="gzt-page">
          <a-tabs v-model:activeKey="activeKey" size="large" :tabBarGutter="24" @change="tabsChange(activeKey)">
            <a-tab-pane key="全部" tab="全部" />
            <a-tab-pane key="IN_PROGRESS" tab="正常进行中的任务" />
            <a-tab-pane key="THREE_DAY_START" tab="3天内开始的任务" />
            <a-tab-pane key="RISK">
              <template #tab>
                <div class="tab-father">
                  风险任务
                  <div class="tab-son" v-if="stateG.riskNum > 0">{{ stateG.riskNum>99?'99+': stateG.riskNum}}</div>
                </div>
              </template>
            </a-tab-pane>
            <a-tab-pane key="DELAY_NOT_COMPLETED">
              <template #tab>
                <div class="tab-father">
                  延期未完成任务
                  <div class="tab-son" v-if="stateG.delayNotCompletedNum > 0"
                    >{{
                      stateG.delayNotCompletedNum>99?'99+':stateG.delayNotCompletedNum
                    }}
                  </div>
                </div>
              </template>
            </a-tab-pane>
            <a-tab-pane key="DELAY_NOT_START">
              <template #tab>
                <div class="tab-father">
                  延期未启动任务
                  <div class="tab-son" v-if="stateG.delayNotStartNum > 0"
                    >{{
                      stateG.delayNotStartNum>99?'99+':stateG.delayNotStartNum
                    }}
                  </div>
                </div>
              </template>
            </a-tab-pane>
            <a-tab-pane key="COUNTDOWN">
              <template #tab>
                <div class="tab-father">
                  7天倒计时任务
                  <div class="tab-son" v-if="stateG.countdownNum > 0">{{ stateG.countdownNum>99?'99+':stateG.countdownNum }}</div>
                </div>
              </template>
            </a-tab-pane>
            <a-tab-pane key="PLAN_COMPLETED_CURRENT_MONTH" tab="当月计划完成任务" />
            <a-tab-pane key="COMPLETED_CURRENT_MONTH" tab="当月已完成任务" />
            <a-tab-pane key="NO_START_CURRENT_MONTH">
              <template #tab>
                <div class="tab-father">
                  当月未启动任务
                  <!--                                <div class="tab-son">{{ stateG.noStartCurrentMonthNum }}</div>-->
                </div>
              </template>
            </a-tab-pane>
          </a-tabs>
          <div class="gzt-search">
            <div class="search-left">
              <div class="left-content">
                <div class="left-icon">
                  <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="24px" height="24px" viewBox="0 0 24 24" version="1.1">
                    <title>警告</title>
                    <g id="页面-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
                      <g id="ppm_pc端工作台1备份" transform="translate(-264, -139)" fill-rule="nonzero">
                        <g id="警告" transform="translate(264, 139)">
                          <rect id="矩形" fill="#000000" opacity="0" x="0" y="0" width="24" height="24" />
                          <path
                            d="M2.55,12 C2.55,15.3761599 4.35115974,18.4958603 7.27499994,20.1839402 C10.1988401,21.8720202 13.8011599,21.8720202 16.7250001,20.1839402 C19.6488403,18.4958603 21.45,15.3761599 21.45,12 C21.45,8.62384014 19.6488402,5.50413976 16.725,3.81605982 C13.8011598,2.12797987 10.1988402,2.12797987 7.27499996,3.81605982 C4.35115976,5.50413976 2.55,8.62384014 2.55,12 L2.55,12 Z"
                            id="路径"
                            fill="#F7B500"
                          />
                          <path
                            d="M12,14.25 C11.55,14.25 11.1,13.8 11.1,13.35 L11.1,6.75 C11.1,6.3 11.55,5.85 12,5.85 C12.45,5.85 12.9,6.3 12.9,6.75 L12.9,13.5 C12.9,13.8 12.45,14.25 12,14.25 Z"
                            id="路径"
                            fill="#FDF0CC"
                          />
                          <path
                            d="M10.95,17.25 C10.95,17.6251289 11.1501289,17.9717623 11.475,18.1593267 C11.7998711,18.3468912 12.2001289,18.3468912 12.525,18.1593267 C12.8498711,17.9717623 13.05,17.6251289 13.05,17.25 C13.05,16.670101 12.579899,16.2 12,16.2 C11.420101,16.2 10.95,16.670101 10.95,17.25 L10.95,17.25 Z"
                            id="路径"
                            fill="#FDF0CC"
                          />
                        </g>
                      </g>
                    </g>
                  </svg>
                </div>
                <div>目前倒计时及加减分内容仅对模板项目展示</div>
              </div>
            </div>
            <div class="search-right">
              <a-input v-model:value="stateG.filter1" class="search-input" placeholder="请输入项目名称" @change="inputChange">
                <template #suffix>
                  <search-outlined />
                </template>
              </a-input>

              <div class="search-radio">
                <a-radio-group v-model:value="stateG.filter2" size="middle" @change="getTableList">
                  <a-radio-button value="0">我负责的</a-radio-button>
                  <a-radio-button value="1">我执行的</a-radio-button>
                  <a-radio-button value="2">我审核的</a-radio-button>
                </a-radio-group>
              </div>
            </div>
          </div>
          <!--          表格-->

          <a-collapse v-model:activeKey="collapseActiveKey" :bordered="false" :expandIconPosition="expandIconPosition">
            <!--                      交付-模板项目任务-->
            <a-collapse-panel key="3" v-if="stateG.templateList.length > 0">
              <template #header>
                <div class="title-main">
                  <div class="collapse-title">
                    <span class="gzt-task-title">交付-模板项目任务 </span><span class="gzt-task-num">({{ stateG.templateList.length }}个)</span>
                  </div>
                  <div class="expand">{{ expandText3 }}</div>
                </div>
              </template>
              <div v-for="(item , index) in stateG.templateList" :key="index" style="margin-bottom: 14px;">
                <div class="top-main-out">
                  <div class="target-div">
                    <div class="top-btn-msg">
                      <div class="target-title"><div class="target-img"></div>当前项目阶段目标：</div>
                      <div class="right-btn" @click="showTotal(item.goals,'当前阶段目标')">查看完整内容></div>
                    </div>
                    <div class="target-content">{{item.goals}}</div>
                  </div>
                  <div class="target-div">
                    <div class="top-btn-msg">
                      <div class="target-title"><div class="road-img"></div>当前项目阶段关键路径：</div>
                      <div class="right-btn" @click="showTotal(item.criticalPath,'当前阶段关键路径')">查看完整内容></div>
                    </div>
                    <div class="target-content">{{item.criticalPath}}</div>
                  </div>
                  <div class="opration-btn">
                    <div class="btn1" @click="showKspx(item.templateWorkbenchTaskDtoList[0].milepostId,'培训')"><div class="btn1-img"></div>培训</div>
                    <div class="btn2" @click="showKspx(item.templateWorkbenchTaskDtoList[0].milepostId,'考试')"><div class="btn2-img"></div>考试</div>
                    <div class="btn3" @click="faqModelFun(item.templateWorkbenchTaskDtoList[0].milepostId)"><div class="btn3-img"></div>FAQ</div>
                  </div>
                </div>
                <div class="gzt-table-box" style="margin-top: 5px">
                  <a-table
                    @resizeColumn="handleTaskResizeColumn"
                    :columns="columnGNew"
                    :row-class-name="(_record, index) => (index % 2 === 1 ? 'table-striped' : null)"
                    bordered
                    :pagination="false"
                    :data-source="item.templateWorkbenchTaskDtoList"
                    :scroll="{ x: jfmbColuns, y: '430px' }"
                  >
                    <template #bodyCell="{ column, record, text }">
                      <template v-if="column.dataIndex === 'taskName'">
                        <div class="task-name">
                          <div
                            v-if="record.mark === '里程碑'"
                            :class="{
                                    'task-milestone': record.mark === '里程碑',
                                    'task-milestone-right':
                                        record.mark === '里程碑' && record.critialPath
                                }"
                            >里程碑
                          </div>
                          <div
                            v-else-if="record.mark === '初验'"
                            :class="{
                                    'task-first': record.mark === '初验',
                                    'task-first-right': record.mark === '初验' && record.critialPath
                                }"
                          ></div>
                          <div
                            v-else-if="record.mark === '终验'"
                            class="task-over"
                            :class="{
                                    'task-over': record.mark === '终验',
                                    'task-over-right': record.mark === '终验' && record.critialPath
                                }"
                          ></div>
                          <div v-if="record.critialPath" class="critical-path">关键路径</div>
                          <div
                            :class="{
                                    'is-first':
                                        (record.mark !== null || record.mark !== '') &&
                                        !record.critialPath,
                                    'is-first-no':
                                        (record.mark === null || record.mark === '') &&
                                        !record.critialPath,
                                    'is-first-path':
                                        (record.mark !== null || record.mark !== '') &&
                                        record.critialPath,
                                    'is-first-path-no-mark':
                                        (record.mark === null || record.mark === '') &&
                                        record.critialPath
                                }"
                          >
                            <a-tooltip placement="top" :overlayStyle="standardStyle" color="#fff">
                              <template #title>
                                <p style="color: #262626; margin: 0">{{ record.taskIndex }} {{ text }}</p>
                              </template>
                              <span class="task-name-title">{{ record.taskIndex }} {{ text }}</span>
                            </a-tooltip>
                          </div>
                        </div>
                      </template>
                      <!-- 倒计时 -->
                      <template v-if="column.dataIndex === 'countDown'">
                        <div class="count-down-content">
                          <a-tooltip placement="top" :overlayStyle="standardStyle" color="#fff" v-if="shouldDisplayCountDownWithTooltip(record.labelList, '倒计时')[0]">
                            <template #title>
                              <div class="count-down-hover">
                                <p v-for="(item, index) in record.hoverLabelList" :key="index">{{
                                    item
                                }}</p>
                              </div>
                            </template>
                            <div class="count-down"
                              >{{
                                splitStringByColon(
                                  shouldDisplayCountDownWithTooltip(record.labelList, '倒计时')[1]
                                )[0]




                              }}:<span class="weight-num">{{
                                  splitStringByColon(
                                    shouldDisplayCountDownWithTooltip(record.labelList, '倒计时')[1]
                                  )[1]
                              }}</span></div
                            >
                          </a-tooltip>
                          <div v-if="shouldDisplayCountDownWithTooltip(record.labelList, '延期')[0]" class="extension-color">
                            {{
                              splitStringByColon(
                                shouldDisplayCountDownWithTooltip(record.labelList, '延期')[1]
                              )[0]




                            }}:<span class="weight-num">{{
                              splitStringByColon(
                                shouldDisplayCountDownWithTooltip(record.labelList, '延期')[1]
                              )[1]
                            }}</span>
                          </div>

                          <div
                            v-if="shouldDisplayCountDownWithTooltip(record.labelList, '项目总监')[0]"
                            :class="{
                                        'all-group-no': hasHyphen(
                                            shouldDisplayCountDownWithTooltip(record.labelList, '项目总监')[1]
                                        ),
                                        'all-group-yes': hasPlus(
                                            shouldDisplayCountDownWithTooltip(record.labelList, '项目总监')[1]
                                        )
                                    }"
                            @click="showScore(record.projectDirectorLabelList,'项目总监')"
                            >{{
                              splitStringByColon(
                                shouldDisplayCountDownWithTooltip(record.labelList, '项目总监')[1]
                              )[0]




                            }}:<span class="weight-num">{{
                                splitStringByColon(
                                  shouldDisplayCountDownWithTooltip(record.labelList, '项目总监')[1]
                                )[1]
                            }}</span></div
                          >

                          <div
                            v-if="shouldDisplayCountDownWithTooltip(record.labelList, '项目经理')[0]"
                            :class="{
                                        'pm-score-no': hasHyphen(
                                            shouldDisplayCountDownWithTooltip(record.labelList, '项目经理')[1]
                                        ),
                                        'pm-score-yes': hasPlus(
                                            shouldDisplayCountDownWithTooltip(record.labelList, '项目经理')[1]
                                        )
                                    }"
                            @click="showScore(record.pmLabelList,'项目经理')"
                            >{{
                              splitStringByColon(
                                shouldDisplayCountDownWithTooltip(record.labelList, '项目经理')[1]
                              )[0]




                            }}:<span class="weight-num">{{
                                splitStringByColon(
                                  shouldDisplayCountDownWithTooltip(record.labelList, '项目经理')[1]
                                )[1]
                            }}</span></div
                          >

                          <div
                            v-if="shouldDisplayCountDownWithTooltip(record.labelList, '任务执行人')[0]"
                            :class="{
                                        'ower-score-no': hasHyphen(
                                            shouldDisplayCountDownWithTooltip(record.labelList, '任务执行人')[1]
                                        ),
                                        'ower-score-yes': hasPlus(
                                            shouldDisplayCountDownWithTooltip(record.labelList, '任务执行人')[1]
                                        )
                                    }"
                            @click="showScore(record.taskOwnerLabelList,'负责人')"
                            >{{
                              splitStringByColon(
                                shouldDisplayCountDownWithTooltip(record.labelList, '任务执行人')[1]
                              )[0]




                            }}:<span class="weight-num">{{
                                splitStringByColon(
                                  shouldDisplayCountDownWithTooltip(record.labelList, '任务执行人')[1]
                                )[1]
                            }}</span></div
                          >
                        </div>
                      </template>
                      <!-- 倒计时 -->
                      <!--                                新-任务进度-->
                      <template v-if="column.dataIndex === 'taskSchedule'">
                        <a-progress
                          :percent="record.taskSchedule"
                          status="active"
                          @click="
                                changeTaskSchedule(
                                    record.operationFlag,
                                    record.taskSchedule,
                                    record.taskId,
                                    record.taskStatus,
                                    '模板'
                                )
                            "
                        />
                      </template>
                      <!--                                新-任务进度-->
                      <!--                                      是否关联目标-->
                      <template v-if="column.dataIndex === 'isAssociatedTarget'">
                        <span v-if="text === '否'" style="color: #f5222d">{{ text }}</span>
                        <span v-else>{{ text }}</span>
                      </template>
                      <!--                                      是否关联目标-->
                      <template v-if="column.dataIndex === 'taskStatus'">
                        <div class="task-status-new" @click="getTaskStatus(record.taskId,0)">
                          <div class="wqd-btn" v-if="text === '未启动'">未启动</div>
                          <div class="jxz-btn" v-else-if="text === '进行中'">进行中</div>
                          <div class="wc-btn" v-else-if="text === '完成'">完成</div>
                          <div class="yq-btn" v-else-if="text === '延期'" color="#F5222D">延期</div>
                          <div class="yqwc-btn" v-else-if="text === '延期完成'" color="#FAAD14">延期完成</div>
                          <div class="spz-btn" v-else-if="text === '审批中'" color="#FAAD14">审批中</div>
                          <div class="wqd-btn" v-else-if="text === '下线'" color="#FAAD14">下线</div>
                          <div v-else>{{ text }}</div>
                        </div>
                      </template>
                      <template v-if="column.dataIndex === 'operation'">
                        <a-space v-if="stateG.filter2 !== '3'">
                          <a-button size="small" type="link" @click="writeDaily(record, '平台项目')" v-if="record.dailySwitch">填写日报 </a-button>
                          <a-divider style="margin: 0; border-color: #3875ff" type="vertical" v-if="record.dailySwitch && stateG.filter2 === '0'" />
                          <a-button size="small" v-if="!record.taskExamStatus || record.taskExamStatus === '未通过'" type="link" @click="handleStart(record)"> 开始 </a-button>
                          <a-button
                            size="small"
                            v-else
                            type="link"
                            @click="beforeOk(record, '模板项目')"
                            v-if="!record.taskFinishTime && stateG.filter2 === '0'"
                            :disabled="record.taskStatus === '审批中'"
                          >
                            完成
                          </a-button>
                          <a-divider
                            style="margin: 0; border-color: #3875ff"
                            type="vertical"
                            v-if="
                                    !record.taskFinishTime &&
                                    stateG.filter2 === '0' &&
                                    record.dailyType !== 5
                                "
                          />
                          <a-button v-if="!record.taskFinishTime && stateG.filter2 === '0'" size="small" type="link" @click="handlerWarning(record)"> 预警 </a-button>
                        </a-space>
                      </template>
                      <!--                                      未关闭风险数量-->
                      <template
                        v-if="
                            column.dataIndex === 'unclosedRiskNumber' ||
                            column.dataIndex === 'riskNumber'
                        "
                      >
                        <span
                          style="color: #3875ff; cursor: pointer"
                          @click="
                                handlerShowRisks(
                                    '模板',
                                    record,
                                    column.dataIndex === 'unclosedRiskNumber' ? '未关闭' : '全部'
                                )
                            "
                          >{{ text }}</span
                        >
                      </template>
                      <!--                                      未关闭风险数量-->
                    </template>
                  </a-table>
                </div>
              </div>
            </a-collapse-panel>
            <!--                      交付-模板项目任务-->

            <!--                      交付-无模板推广项目任务-->
            <a-collapse-panel key="5" v-if="stateG.noTemplateProjectWorkbenchTaskDtoList.length > 0">
              <template #header>
                <div class="title-main">
                  <div class="collapse-title">
                    <span class="gzt-task-title">交付-无模板推广项目任务 </span><span class="gzt-task-num">({{ stateG.noTemplateProjectWorkbenchTaskDtoList.length }}个)</span>
                  </div>
                  <div class="expand">{{ expandText5 }}</div>
                </div>
              </template>
              <div class="gzt-table-box">
                <a-table
                  @resizeColumn="handleTaskResizeColumn"
                  :columns="columnG"
                  :row-class-name="(_record, index) => (index % 2 === 1 ? 'table-striped' : null)"
                  bordered
                  :pagination="false"
                  :data-source="stateG.noTemplateProjectWorkbenchTaskDtoList"
                  :scroll="{ x: jfmbColuns, y: '430px' }"
                >
                  <template #bodyCell="{ column, record, text }">
                    <template v-if="column.dataIndex === 'taskName'">
                      <div class="task-name">
                        <div
                          v-if="record.mark === '里程碑'"
                          :class="{
                                    'task-milestone': record.mark === '里程碑',
                                    'task-milestone-right':
                                        record.mark === '里程碑' && record.critialPath
                                }"
                          >里程碑
                        </div>
                        <div
                          v-else-if="record.mark === '初验'"
                          :class="{
                                    'task-first': record.mark === '初验',
                                    'task-first-right': record.mark === '初验' && record.critialPath
                                }"
                        ></div>
                        <div
                          v-else-if="record.mark === '终验'"
                          class="task-over"
                          :class="{
                                    'task-over': record.mark === '终验',
                                    'task-over-right': record.mark === '终验' && record.critialPath
                                }"
                        ></div>
                        <div v-if="record.critialPath" class="critical-path">关键路径</div>
                        <div
                          :class="{
                                    'is-first':
                                        (record.mark !== null || record.mark !== '') &&
                                        !record.critialPath,
                                    'is-first-no':
                                        (record.mark === null || record.mark === '') &&
                                        !record.critialPath,
                                    'is-first-path':
                                        (record.mark !== null || record.mark !== '') &&
                                        record.critialPath,
                                    'is-first-path-no-mark':
                                        (record.mark === null || record.mark === '') &&
                                        record.critialPath
                                }"
                        >
                          <a-tooltip placement="top" :overlayStyle="standardStyle" color="#fff">
                            <template #title>
                              <p style="color: #262626; margin: 0">{{ record.taskIndex }} {{ text }}</p>
                            </template>
                            <span class="task-name-title">{{ record.taskIndex }} {{ text }}</span>
                          </a-tooltip>
                        </div>
                      </div>
                    </template>
                    <!-- 倒计时 -->
                    <template v-if="column.dataIndex === 'countDown'">
                      <div class="count-down-content">
                        <a-tooltip placement="top" :overlayStyle="standardStyle" color="#fff" v-if="shouldDisplayCountDownWithTooltip(record.labelList, '倒计时')[0]">
                          <template #title>
                            <div class="count-down-hover">
                              <p v-for="(item, index) in record.hoverLabelList" :key="index">{{
                                  item
                              }}</p>
                            </div>
                          </template>
                          <div class="count-down"
                            >{{
                              splitStringByColon(
                                shouldDisplayCountDownWithTooltip(record.labelList, '倒计时')[1]
                              )[0]




                            }}:<span class="weight-num">{{
                                splitStringByColon(
                                  shouldDisplayCountDownWithTooltip(record.labelList, '倒计时')[1]
                                )[1]
                            }}</span></div
                          >
                        </a-tooltip>
                        <div v-if="shouldDisplayCountDownWithTooltip(record.labelList, '延期')[0]" class="extension-color">
                          {{
                            splitStringByColon(
                              shouldDisplayCountDownWithTooltip(record.labelList, '延期')[1]
                            )[0]




                          }}:<span class="weight-num">{{
                            splitStringByColon(
                              shouldDisplayCountDownWithTooltip(record.labelList, '延期')[1]
                            )[1]
                          }}</span>
                        </div>

                        <div
                          v-if="shouldDisplayCountDownWithTooltip(record.labelList, '项目总监')[0]"
                          :class="{
                                        'all-group-no': hasHyphen(
                                            shouldDisplayCountDownWithTooltip(record.labelList, '项目总监')[1]
                                        ),
                                        'all-group-yes': hasPlus(
                                            shouldDisplayCountDownWithTooltip(record.labelList, '项目总监')[1]
                                        )
                                    }"
                          @click="showScore(record.projectDirectorLabelList,'项目总监')"
                          >{{
                            splitStringByColon(
                              shouldDisplayCountDownWithTooltip(record.labelList, '项目总监')[1]
                            )[0]




                          }}:<span class="weight-num">{{
                              splitStringByColon(
                                shouldDisplayCountDownWithTooltip(record.labelList, '项目总监')[1]
                              )[1]
                          }}</span></div
                        >

                        <div
                          v-if="shouldDisplayCountDownWithTooltip(record.labelList, '项目经理')[0]"
                          :class="{
                                        'pm-score-no': hasHyphen(
                                            shouldDisplayCountDownWithTooltip(record.labelList, '项目经理')[1]
                                        ),
                                        'pm-score-yes': hasPlus(
                                            shouldDisplayCountDownWithTooltip(record.labelList, '项目经理')[1]
                                        )
                                    }"
                          @click="showScore(record.pmLabelList,'项目经理')"
                          >{{
                            splitStringByColon(
                              shouldDisplayCountDownWithTooltip(record.labelList, '项目经理')[1]
                            )[0]




                          }}:<span class="weight-num">{{
                              splitStringByColon(
                                shouldDisplayCountDownWithTooltip(record.labelList, '项目经理')[1]
                              )[1]
                          }}</span></div
                        >

                        <div
                          v-if="shouldDisplayCountDownWithTooltip(record.labelList, '任务执行人')[0]"
                          :class="{
                                        'ower-score-no': hasHyphen(
                                            shouldDisplayCountDownWithTooltip(record.labelList, '任务执行人')[1]
                                        ),
                                        'ower-score-yes': hasPlus(
                                            shouldDisplayCountDownWithTooltip(record.labelList, '任务执行人')[1]
                                        )
                                    }"
                          @click="showScore(record.taskOwnerLabelList,'负责人')"
                          >{{
                            splitStringByColon(
                              shouldDisplayCountDownWithTooltip(record.labelList, '任务执行人')[1]
                            )[0]




                          }}:<span class="weight-num">{{
                              splitStringByColon(
                                shouldDisplayCountDownWithTooltip(record.labelList, '任务执行人')[1]
                              )[1]
                          }}</span></div
                        >
                      </div>
                    </template>
                    <!-- 倒计时 -->
                    <!--                                新-任务进度-->
                    <template v-if="column.dataIndex === 'taskSchedule'">
                      <a-progress
                        :percent="record.taskSchedule"
                        status="active"
                        @click="
                                changeTaskSchedule(
                                    record.operationFlag,
                                    record.taskSchedule,
                                    record.taskId,
                                    record.taskStatus,
                                    '模板'
                                )
                            "
                      />
                    </template>
                    <!--                                新-任务进度-->
                    <!--                                      是否关联目标-->
                    <template v-if="column.dataIndex === 'isAssociatedTarget'">
                      <span v-if="text === '否'" style="color: #f5222d">{{ text }}</span>
                      <span v-else>{{ text }}</span>
                    </template>
                    <!--                                      是否关联目标-->
                    <template v-if="column.dataIndex === 'taskStatus'">
                      <div class="task-status-new" @click="getTaskStatus(record.taskId,0)">
                        <div class="wqd-btn" v-if="text === '未启动'">未启动</div>
                        <div class="jxz-btn" v-else-if="text === '进行中'">进行中</div>
                        <div class="wc-btn" v-else-if="text === '完成'">完成</div>
                        <div class="yq-btn" v-else-if="text === '延期'" color="#F5222D">延期</div>
                        <div class="yqwc-btn" v-else-if="text === '延期完成'" color="#FAAD14">延期完成</div>
                        <div class="spz-btn" v-else-if="text === '审批中'" color="#FAAD14">审批中</div>
                        <div class="wqd-btn" v-else-if="text === '下线'" color="#FAAD14">下线</div>
                        <div v-else>{{ text }}</div>
                      </div>
                    </template>
                    <template v-if="column.dataIndex === 'operation'">
                      <a-space v-if="stateG.filter2 !== '3'">
                        <a-button size="small" type="link" @click="writeDaily(record, '平台项目')" v-if="record.dailySwitch">填写日报 </a-button>
                        <a-divider style="margin: 0; border-color: #3875ff" type="vertical" v-if="record.dailySwitch && stateG.filter2 === '0'" />
                        <a-button size="small" v-if="!record.taskExamStatus || record.taskExamStatus === '未通过'" type="link" @click="handleStart(record)"> 开始 </a-button>
                        <a-button
                          size="small"
                          v-else
                          type="link"
                          @click="beforeOk(record, '模板项目')"
                          v-if="!record.taskFinishTime && stateG.filter2 === '0'"
                          :disabled="record.taskStatus === '审批中'"
                        >
                          完成
                        </a-button>
                        <a-divider
                          style="margin: 0; border-color: #3875ff"
                          type="vertical"
                          v-if="
                                    !record.taskFinishTime &&
                                    stateG.filter2 === '0' &&
                                    record.dailyType !== 5
                                "
                        />
                        <a-button v-if="!record.taskFinishTime && stateG.filter2 === '0'" size="small" type="link" @click="handlerWarning(record)"> 预警 </a-button>
                      </a-space>
                    </template>
                    <!--                                      未关闭风险数量-->
                    <template
                      v-if="
                            column.dataIndex === 'unclosedRiskNumber' ||
                            column.dataIndex === 'riskNumber'
                        "
                    >
                      <span
                        style="color: #3875ff; cursor: pointer"
                        @click="
                                handlerShowRisks(
                                    '模板',
                                    record,
                                    column.dataIndex === 'unclosedRiskNumber' ? '未关闭' : '全部'
                                )
                            "
                        >{{ text }}</span
                      >
                    </template>
                    <!--                                      未关闭风险数量-->
                  </template>
                </a-table>
              </div>
            </a-collapse-panel>
            <!--                      交付-无模板推广项目任务-->
            <!--                      交付-行动项任务-->
            <a-collapse-panel key="6" v-if="stateG.actionTaskWorkbenchTaskDtoList.length > 0">
              <template #header>
                <div class="title-main">
                  <div class="collapse-title">
                    <span class="gzt-task-title">交付-行动项任务 </span><span class="gzt-task-num">({{ stateG.actionTaskWorkbenchTaskDtoList.length }}个)</span>
                  </div>
                  <div class="expand">{{ expandText6 }}</div>
                </div>
              </template>
              <div class="gzt-table-box">
                <a-table
                  @resizeColumn="handleTaskResizeColumn"
                  :columns="columnAction"
                  :row-class-name="(_record, index) => (index % 2 === 1 ? 'table-striped' : null)"
                  bordered
                  :pagination="false"
                  :data-source="stateG.actionTaskWorkbenchTaskDtoList"
                  :scroll="{ x: jfmbColuns, y: '430px' }"
                >
                  <template #bodyCell="{ column, record, text }">
                    <template v-if="column.dataIndex === 'taskName'">
                      <div class="task-name">
                        <div
                          v-if="record.mark === '里程碑'"
                          :class="{
                                    'task-milestone': record.mark === '里程碑',
                                    'task-milestone-right':
                                        record.mark === '里程碑' && record.critialPath
                                }"
                          >里程碑
                        </div>
                        <div
                          v-else-if="record.mark === '初验'"
                          :class="{
                                    'task-first': record.mark === '初验',
                                    'task-first-right': record.mark === '初验' && record.critialPath
                                }"
                        ></div>
                        <div
                          v-else-if="record.mark === '终验'"
                          class="task-over"
                          :class="{
                                    'task-over': record.mark === '终验',
                                    'task-over-right': record.mark === '终验' && record.critialPath
                                }"
                        ></div>
                        <div v-if="record.critialPath" class="critical-path">关键路径</div>
                        <div
                          :class="{
                                    'is-first':
                                        (record.mark !== null || record.mark !== '') &&
                                        !record.critialPath,
                                    'is-first-no':
                                        (record.mark === null || record.mark === '') &&
                                        !record.critialPath,
                                    'is-first-path':
                                        (record.mark !== null || record.mark !== '') &&
                                        record.critialPath,
                                    'is-first-path-no-mark':
                                        (record.mark === null || record.mark === '') &&
                                        record.critialPath
                                }"
                        >
                          <a-tooltip placement="top" :overlayStyle="standardStyle" color="#fff">
                            <template #title>
                              <p style="color: #262626; margin: 0">{{ record.taskIndex }} {{ text }}</p>
                            </template>
                            <span class="task-name-title">{{ record.taskIndex }} {{ text }}</span>
                          </a-tooltip>
                        </div>
                      </div>
                    </template>
                    <!-- 倒计时 -->
                    <template v-if="column.dataIndex === 'countDown'">
                      <div class="count-down-content">
                        <a-tooltip placement="top" :overlayStyle="standardStyle" color="#fff" v-if="shouldDisplayCountDownWithTooltip(record.labelList, '倒计时')[0]">
                          <template #title>
                            <div class="count-down-hover">
                              <p v-for="(item, index) in record.hoverLabelList" :key="index">{{
                                  item
                              }}</p>
                            </div>
                          </template>
                          <div class="count-down"
                            >{{
                              splitStringByColon(
                                shouldDisplayCountDownWithTooltip(record.labelList, '倒计时')[1]
                              )[0]




                            }}:<span class="weight-num">{{
                                splitStringByColon(
                                  shouldDisplayCountDownWithTooltip(record.labelList, '倒计时')[1]
                                )[1]
                            }}</span></div
                          >
                        </a-tooltip>
                        <div v-if="shouldDisplayCountDownWithTooltip(record.labelList, '延期')[0]" class="extension-color">
                          {{
                            splitStringByColon(
                              shouldDisplayCountDownWithTooltip(record.labelList, '延期')[1]
                            )[0]




                          }}:<span class="weight-num">{{
                            splitStringByColon(
                              shouldDisplayCountDownWithTooltip(record.labelList, '延期')[1]
                            )[1]
                          }}</span>
                        </div>

                        <div
                          v-if="shouldDisplayCountDownWithTooltip(record.labelList, '项目总监')[0]"
                          :class="{
                                        'all-group-no': hasHyphen(
                                            shouldDisplayCountDownWithTooltip(record.labelList, '项目总监')[1]
                                        ),
                                        'all-group-yes': hasPlus(
                                            shouldDisplayCountDownWithTooltip(record.labelList, '项目总监')[1]
                                        )
                                    }"
                          @click="showScore(record.projectDirectorLabelList,'项目总监')"
                          >{{
                            splitStringByColon(
                              shouldDisplayCountDownWithTooltip(record.labelList, '项目总监')[1]
                            )[0]




                          }}:<span class="weight-num">{{
                              splitStringByColon(
                                shouldDisplayCountDownWithTooltip(record.labelList, '项目总监')[1]
                              )[1]
                          }}</span></div
                        >

                        <div
                          v-if="shouldDisplayCountDownWithTooltip(record.labelList, '项目经理')[0]"
                          :class="{
                                        'pm-score-no': hasHyphen(
                                            shouldDisplayCountDownWithTooltip(record.labelList, '项目经理')[1]
                                        ),
                                        'pm-score-yes': hasPlus(
                                            shouldDisplayCountDownWithTooltip(record.labelList, '项目经理')[1]
                                        )
                                    }"
                          @click="showScore(record.pmLabelList,'项目经理')"
                          >{{
                            splitStringByColon(
                              shouldDisplayCountDownWithTooltip(record.labelList, '项目经理')[1]
                            )[0]




                          }}:<span class="weight-num">{{
                              splitStringByColon(
                                shouldDisplayCountDownWithTooltip(record.labelList, '项目经理')[1]
                              )[1]
                          }}</span></div
                        >

                        <div
                          v-if="shouldDisplayCountDownWithTooltip(record.labelList, '任务执行人')[0]"
                          :class="{
                                        'ower-score-no': hasHyphen(
                                            shouldDisplayCountDownWithTooltip(record.labelList, '任务执行人')[1]
                                        ),
                                        'ower-score-yes': hasPlus(
                                            shouldDisplayCountDownWithTooltip(record.labelList, '任务执行人')[1]
                                        )
                                    }"
                          @click="showScore(record.taskOwnerLabelList,'负责人')"
                          >{{
                            splitStringByColon(
                              shouldDisplayCountDownWithTooltip(record.labelList, '任务执行人')[1]
                            )[0]




                          }}:<span class="weight-num">{{
                              splitStringByColon(
                                shouldDisplayCountDownWithTooltip(record.labelList, '任务执行人')[1]
                              )[1]
                          }}</span></div
                        >
                      </div>
                    </template>
                    <!-- 倒计时 -->
                    <!--                                新-任务进度-->
                    <template v-if="column.dataIndex === 'taskSchedule'">
                      <a-progress
                        :percent="record.taskSchedule"
                        status="active"
                        @click="
                                changeTaskSchedule(
                                    record.operationFlag,
                                    record.taskSchedule,
                                    record.taskId,
                                    record.taskStatus,
                                    '模板'
                                )
                            "
                      />
                    </template>
                    <!--                                新-任务进度-->
                    <!--                                      是否关联目标-->
                    <template v-if="column.dataIndex === 'isAssociatedTarget'">
                      <span v-if="text === '否'" style="color: #f5222d">{{ text }}</span>
                      <span v-else>{{ text }}</span>
                    </template>
                    <!--                                      是否关联目标-->
                    <template v-if="column.dataIndex === 'taskStatus'">
                      <div class="task-status-new" @click="getTaskStatus(record.actionTaskId,1)">
                        <div class="wqd-btn" v-if="text === '未启动'">未启动</div>
                        <div class="jxz-btn" v-else-if="text === '进行中'">进行中</div>
                        <div class="wc-btn" v-else-if="text === '完成'">完成</div>
                        <div class="yq-btn" v-else-if="text === '延期'" color="#F5222D">延期</div>
                        <div class="yqwc-btn" v-else-if="text === '延期完成'" color="#FAAD14">延期完成</div>
                        <div class="spz-btn" v-else-if="text === '审批中'" color="#FAAD14">审批中</div>
                        <div class="wqd-btn" v-else-if="text === '下线'" color="#FAAD14">下线</div>
                        <div v-else>{{ text }}</div>
                      </div>
                    </template>
                    <template v-if="column.dataIndex === 'operation'">
                      <a-space v-if="stateG.filter2 !== '3'">
                        <a-button size="small" type="link" @click="writeDaily(record, '平台项目')" v-if="record.dailySwitch">填写日报 </a-button>
                        <a-divider style="margin: 0; border-color: #3875ff" type="vertical" v-if="record.dailySwitch && stateG.filter2 === '0'" />
                        <a-button
                          size="small"
                          v-if="!record.taskExamStatus || record.taskExamStatus === '未通过'"
                          :disabled="
                                    record.taskStatus === '审批中'
                                "
                          type="link"
                          @click="handleStart(record)"
                        >
                          开始
                        </a-button>
                        <a-button
                          size="small"
                          v-else
                          type="link"
                          @click="beforeOk(record, '模板项目')"
                          v-if="!record.taskFinishTime && stateG.filter2 === '0'"
                          :disabled="record.taskStatus === '审批中'"
                        >
                          完成
                        </a-button>
                        <a-divider style="margin: 0; border-color: #3875ff" type="vertical" v-if="!record.taskFinishTime && stateG.filter2 === '0'" />
                        <a-button
                          class="jianxxx"
                          size="small"
                          type="link"
                          @click="handlerEditAction(record, '编辑行动项任务')"
                          :disabled="
                                    record.taskStatus === '审批中' ||
                                    record.taskStatus === '完成' ||
                                    record.taskStatus === '延期完成'
                                "
                          >编辑
                        </a-button>
                        <a-divider style="margin: 0; border-color: #3875ff" type="vertical" v-if="!record.taskFinishTime && stateG.filter2 === '0'" />
                        <a-button v-if="!record.taskFinishTime && stateG.filter2 === '0'" size="small" type="link" @click="handlerWarning(record)"> 预警 </a-button>
                      </a-space>
                    </template>
                    <!--                                      未关闭风险数量-->
                    <template
                      v-if="
                            column.dataIndex === 'unclosedRiskNumber' ||
                            column.dataIndex === 'riskNumber'
                        "
                    >
                      <span
                        style="color: #3875ff; cursor: pointer"
                        @click="
                                handlerShowRisks(
                                    '模板',
                                    record,
                                    column.dataIndex === 'unclosedRiskNumber' ? '未关闭' : '全部'
                                )
                            "
                        >{{ text }}</span
                      >
                    </template>
                    <!--                                      未关闭风险数量-->
                  </template>
                </a-table>
              </div>
            </a-collapse-panel>
            <!--                      交付-行动项任务-->
            <a-collapse-panel key="1" v-if="stateG.platList.length > 0">
              <template #header>
                <div class="title-main">
                  <div class="collapse-title">
                    <span class="gzt-task-title">平台项目任务</span><span class="gzt-task-num">({{ stateG.platList.length }}个)</span>
                  </div>
                  <div class="expand">{{ expandText1 }}</div>
                </div>
              </template>
              <div class="gzt-table-box">
                <a-table
                  :columns="columnG"
                  :row-class-name="(_record, index) => (index % 2 === 1 ? 'table-striped' : null)"
                  :scroll="{ x: scrollX, y: '430px' }"
                  bordered
                  :pagination="false"
                  :data-source="stateG.platList"
                  @resizeColumn="handleTaskResizeColumn"
                >
                  <template #bodyCell="{ column, record, text }">
                    <!--                                新-任务进度-->
                    <template v-if="column.dataIndex === 'taskSchedule'">
                      <a-progress
                        :percent="record.taskSchedule"
                        status="active"
                        @click="
                                changeTaskSchedule(
                                    record.operationFlag,
                                    record.taskSchedule,
                                    record.taskId,
                                    record.taskStatus,
                                    '其他'
                                )
                            "
                      />
                    </template>
                    <!--                                      是否关联目标-->
                    <template v-if="column.dataIndex === 'isAssociatedTarget'">
                      <span v-if="text === '否'" style="color: #f5222d">{{ text }}</span>
                      <span v-else>{{ text }}</span>
                    </template>
                    <!--                                      是否关联目标-->
                    <!--                                新-任务进度-->
                    <template v-if="column.dataIndex === 'taskStatus'">
                      <div class="task-status-new" @click="getTaskStatus(record.taskId,0)">
                        <div class="wqd-btn" v-if="text === '未启动'">未启动</div>
                        <div class="jxz-btn" v-else-if="text === '进行中'">进行中</div>
                        <div class="wc-btn" v-else-if="text === '完成'">完成</div>
                        <div class="yq-btn" v-else-if="text === '延期'" color="#F5222D">延期</div>
                        <div class="yqwc-btn" v-else-if="text === '延期完成'" color="#FAAD14">延期完成</div>
                        <div class="spz-btn" v-else-if="text === '审批中'" color="#FAAD14">审批中</div>
                        <div class="wqd-btn" v-else-if="text === '下线'" color="#FAAD14">下线</div>
                        <div v-else>{{ text }}</div>
                      </div>
                    </template>
                    <template v-if="column.dataIndex === 'operation'">
                      <a-space v-if="stateG.filter2 !== '3'">
                        <a-button size="small" type="link" @click="writeDaily(record, '平台项目')" v-if="record.dailySwitch">填写日报 </a-button>
                        <a-divider style="margin: 0; border-color: #3875ff" type="vertical" v-if="record.dailySwitch && stateG.filter2 === '0'" />
                        <a-button
                          size="small"
                          v-if="
                                    !record.examPassTime
                                "
                          type="link"
                          @click="handleOpen(record)"
                        >
                          开始
                        </a-button>

                        <a-button size="small" v-if="record.examPassTime && stateG.filter2 === '0'" type="link" @click="beforeOk(record, '平台项目')" :disabled="record.taskStatus === '审批中'"
                          >完成
                        </a-button>
                        <a-divider style="margin: 0; border-color: #3875ff" type="vertical" v-if="!record.taskFinishTime && stateG.filter2 === '0'" />
                        <!--                                <a-button size="small" type="link" :disabled="record.disabledEditBtn" @click="handlerEdit(record)">编辑</a-button>-->
                        <!--                                <a-divider style="margin:0;border-color: #3875FF" type="vertical" />-->

                        <a-button v-if="!record.taskFinishTime && stateG.filter2 === '0'" size="small" type="link" @click="handlerWarning(record)"> 预警 </a-button>
                      </a-space>
                    </template>
                    <!--                                      未关闭风险数量-->
                    <template
                      v-if="
                            column.dataIndex === 'unclosedRiskNumber' ||
                            column.dataIndex === 'riskNumber'
                        "
                    >
                      <span
                        style="color: #3875ff; cursor: pointer"
                        @click="
                                handlerShowRisks(
                                    '平台',
                                    record,
                                    column.dataIndex === 'unclosedRiskNumber' ? '未关闭' : '全部'
                                )
                            "
                        >{{ text }}</span
                      >
                    </template>
                    <!--                                      未关闭风险数量-->
                  </template>
                </a-table>
              </div>
            </a-collapse-panel>
            <a-collapse-panel key="2" v-if="stateG.deliveryList.length > 0">
              <template #header>
                <div class="title-main">
                  <div class="collapse-title">
                    <span class="gzt-task-title">交付-通用项目任务 </span><span class="gzt-task-num">({{ stateG.deliveryList.length }}个)</span>
                  </div>
                  <div class="expand">{{ expandText2 }}</div>
                </div>
              </template>
              <div class="gzt-table-box">
                <a-table
                  @resizeColumn="handleTaskResizeColumn"
                  :pagination="false"
                  :row-class-name="(_record, index) => (index % 2 === 1 ? 'table-striped' : null)"
                  :columns="jfColuns"
                  bordered
                  :data-source="stateG.deliveryList"
                  :scroll="{ x: scrolljfX, y: '430px' }"
                >
                  <template #bodyCell="{ column, record, text }">
                    <!--                                新-任务进度-->
                    <template v-if="column.dataIndex === 'taskSchedule'">
                      <a-progress
                        :percent="record.taskSchedule"
                        status="active"
                        @click="
                                changeTaskSchedule(
                                    record.operationFlag,
                                    record.taskSchedule,
                                    record.taskId,
                                    record.taskStatus,
                                    '其他'
                                )
                            "
                      />
                    </template>
                    <!--                                新-任务进度-->
                    <!--                                      是否关联目标-->
                    <template v-if="column.dataIndex === 'isAssociatedTarget'">
                      <span v-if="text === '否'" style="color: #f5222d">{{ text }}</span>
                      <span v-else>{{ text }}</span>
                    </template>
                    <!--                                      是否关联目标-->
                    <template v-if="column.dataIndex === 'taskStatus'">
                      <div class="task-status-new" @click="getTaskStatus(record.taskId,0)">
                        <div class="wqd-btn" v-if="text === '未启动'">未启动</div>
                        <div class="jxz-btn" v-else-if="text === '进行中'">进行中</div>
                        <div class="wc-btn" v-else-if="text === '完成'">完成</div>
                        <div class="yq-btn" v-else-if="text === '延期'" color="#F5222D">延期</div>
                        <div class="yqwc-btn" v-else-if="text === '延期完成'" color="#FAAD14">延期完成</div>
                        <div class="spz-btn" v-else-if="text === '审批中'" color="#FAAD14">审批中</div>
                        <div class="wqd-btn" v-else-if="text === '下线'" color="#FAAD14">下线</div>
                        <div v-else>{{ text }}</div>
                      </div>
                    </template>
                    <template v-if="column.dataIndex === 'operation'">
                      <a-space v-if="stateG.filter2 !== '3'">
                        <a-button size="small" type="link" @click="writeDaily(record, '平台项目')" v-if="record.dailySwitch">填写日报 </a-button>
                        <a-divider style="margin: 0; border-color: #3875ff" type="vertical" v-if="record.dailySwitch && stateG.filter2 === '0'" />
                        <!--                        <a-button-->
                        <!--                          size="small"-->
                        <!--                          v-if="-->
                        <!--                                    (!record.taskExamStatus ||-->
                        <!--                                        record.taskExamStatus === '未通过') &&-->
                        <!--                                    record.dailyType === 5-->
                        <!--                                "-->
                        <!--                          type="link"-->
                        <!--                          @click="handleStart(record)"-->
                        <!--                        >-->
                        <!--                          开始-->
                        <!--                        </a-button>-->
                        <!--                        <a-button-->
                        <!--                          size="small"-->
                        <!--                          type="link"-->
                        <!--                          @click="beforeOk(record, '交付通用项目')"-->
                        <!--                          v-if="record.taskExamStatus === '已通过' && record.dailyType === 5"-->
                        <!--                          :disabled="record.taskStatus === '审批中'"-->
                        <!--                        >完成-->
                        <!--                        </a-button-->
                        <!--                        >-->
                        <!--                        <a-button-->
                        <!--                          size="small"-->
                        <!--                          type="link"-->
                        <!--                          @click="beforeOk(record, '交付通用项目')"-->
                        <!--                          v-if="-->
                        <!--                                    !record.taskFinishTime &&-->
                        <!--                                    stateG.filter2 === '0' &&-->
                        <!--                                    record.dailyType !== 5-->
                        <!--                                "-->
                        <!--                          :disabled="record.taskStatus === '审批中'"-->
                        <!--                        >完成-->
                        <!--                        </a-button-->
                        <!--                        >-->
                        <a-button
                          size="small"
                          v-if="
                                    !record.examPassTime
                                "
                          type="link"
                          @click="handleOpen(record)"
                        >
                          开始
                        </a-button>

                        <a-button size="small" v-if="record.examPassTime && stateG.filter2 === '0'" type="link" @click="beforeOk(record, '交付通用项目')" :disabled="record.taskStatus === '审批中'"
                          >完成
                        </a-button>
                        <a-divider style="margin: 0; border-color: #3875ff" type="vertical" v-if="!record.taskFinishTime && stateG.filter2 === '0'" />
                        <!--                                <a-button size="small" type="link" :disabled="record.disabledEditBtn" @click="handlerEdit(record)">编辑</a-button>-->
                        <!--                                <a-divider style="margin:0;border-color: #3875FF" type="vertical" />-->
                        <a-button size="small" type="link" @click="handlerWarning(record)" v-if="!record.taskFinishTime && stateG.filter2 === '0'"> 预警 </a-button>
                      </a-space>
                    </template>
                    <!--                                      未关闭风险数量-->
                    <template
                      v-if="
                            column.dataIndex === 'unclosedRiskNumber' ||
                            column.dataIndex === 'riskNumber'
                        "
                    >
                      <span
                        style="color: #3875ff; cursor: pointer"
                        @click="
                                handlerShowRisks(
                                    '交付',
                                    record,
                                    column.dataIndex === 'unclosedRiskNumber' ? '未关闭' : '全部'
                                )
                            "
                        >{{ text }}</span
                      >
                    </template>
                    <!--                                      未关闭风险数量-->
                  </template>
                </a-table>
              </div>
            </a-collapse-panel>

            <a-collapse-panel key="4" v-if="stateG.marketList.length > 0">
              <template #header>
                <div class="title-main">
                  <div class="collapse-title">
                    <span class="gzt-task-title">市场及更多项目任务 </span><span class="gzt-task-num">({{ stateG.marketList.length }}个)</span>
                  </div>
                  <div class="expand">{{ expandText4 }}</div>
                </div>
              </template>
              <div class="gzt-table-box">
                <a-table
                  @resizeColumn="handleTaskResizeColumn"
                  :row-class-name="(_record, index) => (index % 2 === 1 ? 'table-striped' : null)"
                  :columns="scColuns"
                  bordered
                  :scroll="{ x: scrollscX, y: '430px' }"
                  :data-source="stateG.marketList"
                  :pagination="false"
                >
                  <template #bodyCell="{ column, record, text }">
                    <!--                                新-任务进度-->
                    <template v-if="column.dataIndex === 'taskSchedule'">
                      <a-progress
                        :percent="record.taskSchedule"
                        status="active"
                        @click="
                                changeTaskSchedule(
                                    record.operationFlag,
                                    record.taskSchedule,
                                    record.taskId,
                                    record.taskStatus,
                                    '其他'
                                )
                            "
                      />
                    </template>
                    <!--                                新-任务进度-->
                    <!--                                      是否关联目标-->
                    <template v-if="column.dataIndex === 'isAssociatedTarget'">
                      <span v-if="text === '否'" style="color: #f5222d">{{ text }}</span>
                      <span v-else>{{ text }}</span>
                    </template>
                    <!--                                      是否关联目标-->
                    <template v-if="column.dataIndex === 'taskStatus'">
                      <div class="task-status-new" @click="getTaskStatus(record.taskId,0)">
                        <div class="wqd-btn" v-if="text === '未启动'">未启动</div>
                        <div class="jxz-btn" v-else-if="text === '进行中'">进行中</div>
                        <div class="wc-btn" v-else-if="text === '完成'">完成</div>
                        <div class="yq-btn" v-else-if="text === '延期'" color="#F5222D">延期</div>
                        <div class="yqwc-btn" v-else-if="text === '延期完成'" color="#FAAD14">延期完成</div>
                        <div class="spz-btn" v-else-if="text === '审批中'" color="#FAAD14">审批中</div>
                        <div class="wqd-btn" v-else-if="text === '下线'" color="#FAAD14">下线</div>
                        <div v-else>{{ text }}</div>
                      </div>
                    </template>
                    <template v-if="column.dataIndex === 'operation'">
                      <a-space v-if="stateG.filter2 !== '3'">
                        <a-button size="small" type="link" @click="writeDaily(record, '市场及更多')" v-if="record.dailySwitch && stateG.filter2 === '0'">填写日报 </a-button>
                        <a-divider style="margin: 0; border-color: #3875ff" type="vertical" v-if="record.dailySwitch && stateG.filter2 === '0'" />
                        <a-button size="small" v-if="!record.examPassTime&& stateG.filter2 === '0'" type="link" @click="handleOpen(record)"> 开始 </a-button>
                        <a-divider style="margin: 0; border-color: #3875ff" type="vertical" v-if="!record.examPassTime&& stateG.filter2 === '0'" />
                        <a-button size="small" type="link" @click="beforeOk(record, '市场项目')" v-if="record.examPassTime && stateG.filter2 === '0'">完成 </a-button>

                        <a-divider style="margin: 0; border-color: #3875ff" type="vertical" v-if="record.taskFinishTime && stateG.filter2 === '0'" />

                        <a-button v-if="!record.taskFinishTime && stateG.filter2 === '0'" size="small" type="link" @click="handlerWarning(record)"> 预警 </a-button>
                      </a-space>
                    </template>
                    <!--                                      未关闭风险数量-->
                    <template
                      v-if="
                            column.dataIndex === 'unclosedRiskNumber' ||
                            column.dataIndex === 'riskNumber'
                        "
                    >
                      <span
                        style="color: #3875ff; cursor: pointer"
                        @click="
                                handlerShowRisks(
                                    '市场',
                                    record,
                                    column.dataIndex === 'unclosedRiskNumber' ? '未关闭' : '全部'
                                )
                            "
                        >{{ text }}</span
                      >
                    </template>
                    <!--                                      未关闭风险数量-->
                  </template>
                </a-table>
              </div>
            </a-collapse-panel>
            <!--            工单任务-->
            <!--                      交付-行动项任务-->
            <a-collapse-panel key="7" v-if="stateG.workOrderDtoList.length > 0">
              <template #header>
                <div class="title-main">
                  <div class="collapse-title">
                    <span class="gzt-task-title">工单任务 </span><span class="gzt-task-num">({{ stateG.workOrderDtoList.length }}个)</span>
                  </div>
                  <div class="expand">{{ expandText7 }}</div>
                </div>
              </template>
              <div class="gzt-table-box">
                <a-table
                  @resizeColumn="handleTaskResizeColumn"
                  :columns="columnGd"
                  :row-class-name="(_record, index) => (index % 2 === 1 ? 'table-striped' : null)"
                  bordered
                  :pagination="false"
                  :data-source="stateG.workOrderDtoList"
                  :scroll="{ x: jfmbColuns, y: '430px' }"
                >
                  <template #bodyCell="{ column, record, text }">
                    <!-- 倒计时 -->
                    <!--                                      是否关联目标-->
                    <template v-if="column.dataIndex === 'isAssociatedTarget'">
                      <span v-if="text === '否'" style="color: #f5222d">{{ text }}</span>
                      <span v-else>{{ text }}</span>
                    </template>
                    <!--                                      是否关联目标-->

                    <template v-if="column.dataIndex === 'operation'">
                      <a-space v-if="stateG.filter2 !== '3'">
                        <a-button size="small" type="link" @click="writeDaily(record, '工单任务')">填写日报 </a-button>
                        <a-divider style="margin: 0; border-color: #3875ff" type="vertical" />
                        <a-button size="small" type="link" @click="jumpGd(record)">查看 </a-button>
                      </a-space>
                    </template>
                  </template>
                </a-table>
              </div>
            </a-collapse-panel>
            <!--                      交付-行动项任务-->
            <!--            工单任务-->
          </a-collapse>
          <!--          表格-->
          <!--              无数据提示-->

          <div
            class="no-data"
            v-if="
        stateG.platList.length == 0 &&
        stateG.deliveryList.length == 0 &&
        stateG.marketList.length == 0 &&
        stateG.templateList.length == 0 &&
        stateG.actionTaskWorkbenchTaskDtoList.length == 0 &&
        stateG.noTemplateProjectWorkbenchTaskDtoList.length == 0&&
        stateG.workOrderDtoList.length == 0
    "
          >
            <div class="no-tip"> 暂无数据</div>
          </div>
        </div>

        <a-modal v-model:visible="stateG.recordVisible" centered title="新建日报" width="800px" destroyOnClose :body-style="stateG.bodyStyle" @cancel="recordCancel">
          <template #footer>
            <a-button key="back" @click="recordCancel">取消</a-button>
            <a-button key="back" type="primary" @click="confirmDailyRecord(false)">保存</a-button>
            <a-button key="submit" type="primary" @click="confirmDailyRecord(true)">保存并提交</a-button>
          </template>
          <a-form ref="recordRef" :model="stateG.recordForm">
            <div class="title-new">
              <div class="now-img"></div>
              正在编辑工时：<span class="record-num">{{ stateG.recordForm.workingHours }}工时 </span>
              <div class="today-img"></div>
              今日已提交总工时（不含本次提交）：<span class="record-num">{{ stateG.allHours }}工时 </span></div
            >
            <a-row :gutter="24">
              <a-col :span="12">
                <a-form-item label="工时对应日期" name="dailyDate" :rules="[{ required: true, message: '请选择工时对应日期' }]" :label-col="{ span: 7 }">
                  <a-date-picker v-model:value="stateG.recordForm.dailyDate" :valueFormat="'YYYY-MM-DD'" style="width: 100%" @change="changeDate" />
                </a-form-item>
              </a-col>
              <a-col :span="12">
                <a-form-item label="工时" name="workingHours" :rules="[{ required: true, message: '请输入工时' }]" :label-col="{ span: 7 }">
                  <a-input-number v-model:value="stateG.recordForm.workingHours" style="width: 100%" />
                </a-form-item>
              </a-col>
            </a-row>
            <a-row>
              <a-col :span="24">
                <a-form-item label="是否有风险" name="risk" :rules="[{ required: true, message: '请选择是否有风险' }]">
                  <a-radio-group v-model:value="stateG.recordForm.risk">
                    <a-radio value="是">是</a-radio>
                    <a-radio value="否">否</a-radio>
                  </a-radio-group>
                </a-form-item>
              </a-col>
            </a-row>
            <a-row v-if="stateG.recordForm.risk === '是'">
              <a-col :span="24">
                <a-form-item label="风险描述" name="riskDescription" :rules="[{ required: true, message: '请输入风险描述' }]">
                  <a-input v-model:value="stateG.recordForm.riskDescription" />
                </a-form-item>
              </a-col>
            </a-row>
            <a-row v-if="stateG.recordForm.risk === '是'">
              <a-col :span="24">
                <a-form-item label="解决方案" name="solution" :rules="[{ required: true, message: '请输入解决方案' }]">
                  <a-input v-model:value="stateG.recordForm.solution" />
                </a-form-item>
              </a-col>
            </a-row>
          </a-form>
        </a-modal>
        <!-- 新-模板项目检查清单弹出框 -->
        <a-modal
          :visible="stateG.templateOkVisible"
          title="完成任务"
          destroyOnClose
          centered
          width="40%"
          :ok-button-props="{ disabled: btnLoading }"
          :getContainer="getModalContainer"
          @cancel="stateG.templateOkVisible = false"
        >
          <div style="margin-bottom: 10px">
            <!-- 完成标准 -->
            <a-form-item label="实际起止时间">
              <a-range-picker show-time style="width: 360px;" v-model:value="jfMbActualFinishTime" value-format="YYYY-MM-DD HH:mm:ss" />
            </a-form-item>
            <div class="new-check">
              <div class="label">完成标准</div>
            </div>
            <div class="checkbox-group" v-for="(item, index) in CompletionCheckListCheckList" :key="index">
              <a-checkbox v-model:checked="item.selected">
                {{ item.content }}
              </a-checkbox>
            </div>
            <!-- 审核标准 -->
            <div class="new-check" v-if="ppmTemplateCheckList.length > 0">
              <div class="label">审核标准及注意事项</div>
            </div>
            <div v-for="(item, index) in ppmTemplateCheckList" :key="index" class="checkbox-group">
              <div v-html="formatContent(item.content)"></div>
            </div>
            <!-- 审核标准 -->
            <!--                        sop-->
            <div class="new-check" v-if="sopList[0].contentList.length > 0">
              <div class="label">SOP</div>
            </div>
            <div class="checkbox-group">
              <a-checkbox v-for="(msg, index) in sopList[0].contentList" :key="index" v-model:checked="msg.selected">
                {{ msg.msg }}
              </a-checkbox>
            </div>
            <!--                        sop-->
          </div>

          <template #footer>
            <a-button key="back" type="primary" @click="downLoadTemplate">下载模板</a-button>
            <a-button key="back" @click="stateG.templateOkVisible = false">取消</a-button>
            <a-button key="back" @click="handleSubmitSop">暂存SOP</a-button>
            <a-button key="submit" type="primary" :loading="btnLoading" @click="handlerTemplateOk">提交审批</a-button>
          </template>
          <a-spin :spinning="uploadingJf" tip="附件上传中...">
            <a-upload :file-list="stateG.fileList" :before-upload="handlerUpload" @remove="handleRemove" accept=".xlsx,.ppt,.pdf,.PDF, image/*, .docx, .rp, .xls">
              <a-button type="primary">
                <upload-outlined />
                上传
              </a-button>
            </a-upload>
            <span>支持格式：image/*,.xlsx,.xls,.docx,.rp,.ppt,.pptx,.pdf</span>
          </a-spin>
        </a-modal>
        <!-- 模板项目检查清单弹出框 -->
        <!--          通用交付项目完成弹窗-->
        <a-modal :visible="stateG.okVisible" title="检查清单列表" destroyOnClose centered width="40%" @cancel="stateG.okVisible = false" @ok="handlerJfOk">
          <div style="margin-bottom: 10px" v-if="ppmCheckList.length > 0">
            <div v-for="(item, index) in ppmCheckList" :key="index" class="checkbox-group">
              <div class="label">{{ item.name }}</div>
              <a-checkbox v-for="(item2, index2) in item.value" :key="index2" :checked="ppmCheckedList.includes(item2.checkEntryId)" @change="ppmCheckedListChange(item2.checkEntryId)">
                {{ item2.checkEntry }}
              </a-checkbox>
            </div>
          </div>
          <a-upload :file-list="stateG.fileList" :before-upload="handlerUpload" @remove="handleRemove" accept=".xlsx,.ppt,.pdf,.PDF, image/*, .docx, .rp, .xls">
            <a-button type="primary">
              <upload-outlined />
              上传
            </a-button>
          </a-upload>
          <span>支持格式：image/*,.xlsx,.xls,.docx,.rp,.ppt,.pptx,.pdf</span>
        </a-modal>
        <!--          end通用交付项目完成弹窗-->

        <!--          平台项目完成弹窗-->
        <a-modal
          :visible="stateG.ptOkVisible"
          title="检查清单列表"
          destroyOnClose
          centered
          width="40%"
          @cancel="stateG.ptOkVisible = false"
          @ok="handlerPtOk"
          :ok-button-props="{ loading:okPtLoading }"
        >
          <div style="margin-bottom: 10px" v-if="ppmCheckList.length > 0">
            <div v-for="(item, index) in ppmCheckList" :key="index" class="checkbox-group">
              <div class="label">{{ item.name }}</div>
              <a-checkbox v-for="(item2, index2) in item.value" :key="index2" :checked="ppmCheckedList.includes(item2.checkEntryId)" @change="ppmCheckedListChange(item2.checkEntryId)">
                {{ item2.checkEntry }}
              </a-checkbox>
            </div>
          </div>
          <a-upload :file-list="stateG.fileList" :before-upload="handlerUpload" @remove="handleRemove" accept=".xlsx,.ppt,.pptx,.pdf,.PDF, image/*, .docx, .rp, .xls">
            <a-button type="primary">
              <upload-outlined />
              上传
            </a-button>
          </a-upload>
          <span>支持格式：image/*,.xlsx,.xls,.docx,.rp,.ppt,.pptx,.pdf,.PDF, </span>
        </a-modal>
        <!--          end平台项目完成弹窗-->
        <!--          风险预警-->
        <a-modal v-model:visible="stateG.warringVisible" title="新增任务风险" @ok="handleTemplateRiskOk" centered :body-style="{ paddingBottom: '0' }">
          <a-form :model="stateG.templateRisk" ref="templateRiskRef">
            <a-row>
              <a-col :span="24">
                <a-form-item label="任务名称" name="taskName" :rules="[{ required: true, message: '请输入任务名称', trigger: 'blur' }]">
                  <a-input v-model:value="stateG.templateRisk.taskName" disabled />
                </a-form-item>
              </a-col>
              <a-col :span="24">
                <a-form-item label="风险描述" name="riskDescription" :rules="[{ required: true, message: '请输入风险描述', trigger: 'blur' }]">
                  <a-input v-model:value="stateG.templateRisk.riskDescription" />
                </a-form-item>
              </a-col>
              <a-col :span="24">
                <a-form-item label="解决方案" name="solution" :rules="[{ required: true, message: '请输入解决方案', trigger: 'blur' }]">
                  <a-input v-model:value="stateG.templateRisk.solution" />
                </a-form-item>
              </a-col>
            </a-row>
          </a-form>
        </a-modal>
        <!--          end风险预警-->
        <!--          FAQ-->
        <a-modal
          v-model:visible="examsVisible"
          :closable="false"
          :footer="null"
          :width="720"
          :centered="true"
          :destroyOnClose="true"
          :keyboard="false"
          :maskClosable="false"
          :body-style="{ maxHeight: '800px', overflowY: 'auto', overflowX: 'hidden', padding: 0 }"
          wrapClassName="exam-wrapper"
        >
          <div style="margin: 16px 24px; font-weight: bold; font-size: 16px; color: #262626; line-height: 1">
            {{ taskModalText.modalTitle }}
          </div>
          <a-divider style="margin: 0px; background: #ebebeb" />
          <al-box :class="['tips', taskState.isExam ? 'exam' : '']" align="center" justify="start">
            <img
              class="icon"
              src="data:image/svg+xml;charset=utf-8;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iMTZweCIgaGVpZ2h0PSIxNnB4IiB2aWV3Qm94PSIwIDAgMTYgMTYiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8ZyBpZD0i6aG16Z2iLTEiIHN0cm9rZT0ibm9uZSIgc3Ryb2tlLXdpZHRoPSIxIiBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPgogICAgICAgIDxnIGlkPSLlvIDlp4vlrabkuaAt5pyA6auY6auY5bqmODAwcHjmoIfms6giIHRyYW5zZm9ybT0idHJhbnNsYXRlKC00MCwgLTgxKSI+CiAgICAgICAgICAgIDxnIGlkPSLlm77moIcv6YCa55So5Zu+5qCHL+ivtOaYjiIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoNDAsIDgxKSI+CiAgICAgICAgICAgICAgICA8cmVjdCBpZD0i55+p5b2i5aSH5Lu9LTgwIiBmaWxsPSIjRDhEOEQ4IiBvcGFjaXR5PSIwIiB4PSIwIiB5PSIwIiB3aWR0aD0iMTYiIGhlaWdodD0iMTYiPjwvcmVjdD4KICAgICAgICAgICAgICAgIDxnIGlkPSLnvJbnu4QtMTkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDEuNTc2NywgMS40OTUzKSI+CiAgICAgICAgICAgICAgICAgICAgPHBhdGggZD0iTTYuNSwxMyBDMTAuMDg5ODUwOSwxMyAxMywxMC4wODk4NTA5IDEzLDYuNSBDMTMsMi45MTAxNDkxMyAxMC4wODk4NTA5LDAgNi41LDAgQzIuOTEwMTQ5MTMsMCAwLDIuOTEwMTQ5MTMgMCw2LjUgQzAsMTAuMDg5ODUwOSAyLjkxMDE0OTEzLDEzIDYuNSwxMyBaIiBpZD0i5qSt5ZyG5b2i5aSH5Lu9LTQiIHN0cm9rZT0iI0ZBQUQxNCIgc3Ryb2tlLXdpZHRoPSIwLjk5NTMyOCI+PC9wYXRoPgogICAgICAgICAgICAgICAgICAgIDxsaW5lIHgxPSI2LjQ2NDM1NTQ3IiB5MT0iMy41OTc2MTE2NCIgeDI9IjYuNDY0MzU1NDciIHkyPSI3LjcxOTU1OTg4IiBpZD0i6Lev5b6ELTciIHN0cm9rZT0iI0ZBQUQxNCIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIj48L2xpbmU+CiAgICAgICAgICAgICAgICAgICAgPHBhdGggZD0iTTYuNTIyMzM4ODcsMTAuMDA0NzE2MSBDNi45MzY1NTI0MywxMC4wMDQ3MTYxIDcuMjcyMzM4ODcsOS42Njg5Mjk3IDcuMjcyMzM4ODcsOS4yNTQ3MTYxMyBDNy4yNzIzMzg4Nyw4Ljg0MDUwMjU3IDYuOTM2NTUyNDMsOC41MDQ3MTYxMyA2LjUyMjMzODg3LDguNTA0NzE2MTMgQzYuMTA4MTI1Myw4LjUwNDcxNjEzIDUuNzcyMzM4ODcsOC44NDA1MDI1NyA1Ljc3MjMzODg3LDkuMjU0NzE2MTMgQzUuNzcyMzM4ODcsOS42Njg5Mjk3IDYuMTA4MTI1MywxMC4wMDQ3MTYxIDYuNTIyMzM4ODcsMTAuMDA0NzE2MSBaIiBpZD0i5qSt5ZyG5b2iIiBmaWxsPSIjRkFBRDE0Ij48L3BhdGg+CiAgICAgICAgICAgICAgICA8L2c+CiAgICAgICAgICAgIDwvZz4KICAgICAgICA8L2c+CiAgICA8L2c+Cjwvc3ZnPg=="
            />
            <span>{{ taskModalText.tipText }}</span>
          </al-box>
          <div class="content-wrapper">
            <a-spin :spinning="taskState.loading" tip="准备考题中，请稍后...">
              <div class="section">
                <template v-for="(finishQ, finishQindex) in taskState.finishQList" :key="finishQindex">
                  <a-row class="table">
                    <a-col class="title" :span="4">题目来源</a-col>
                    <a-col class="content" :span="20">完成标准</a-col>
                    <a-col class="title" :span="4">题目</a-col>
                    <a-col class="content" :span="20">
                      <div v-if="!taskState.isExam" v-html="formatText(finishQ.studyQuestion)"></div>
                      <div v-else v-html="formatText(finishQ.examQuestion)"></div>
                      <div v-if="taskState.isExam && finishQ.examQuestion">
                        <a-radio-group
                          style="width: 100%"
                          v-model:value="
                                    taskState.questionRef[`finishQ${String(finishQ.questionId)}`]
                                "
                        >
                          <a-row>
                            <a-col
                              :span="24"
                              v-for="(optionItem, optionIndex) in finishQ.examOption
                                            .split(/[;,]/)
                                            .filter(item => item.trim() !== '')"
                              :key="optionIndex"
                            >
                              <a-radio :style="taskState.radioStyle" :value="optionItem.charAt(0)">
                                {{ optionItem }}
                              </a-radio>
                            </a-col>
                          </a-row>
                        </a-radio-group>
                      </div>
                    </a-col>
                  </a-row>
                </template>
                <template v-for="(sopQ, sopQindex) in taskState.sopQList" :key="sopQindex">
                  <a-row class="table">
                    <a-col class="title" :span="4">题目来源</a-col>
                    <a-col class="content" :span="20">SOP</a-col>
                    <a-col class="title" :span="4">题目</a-col>
                    <a-col class="content" :span="20">
                      <div v-if="!taskState.isExam" v-html="formatText(sopQ.studyQuestion)"></div>
                      <div v-else v-html="formatText(sopQ.examQuestion)"></div>
                      <div v-if="taskState.isExam && sopQ.examQuestion">
                        <a-radio-group
                          style="width: 100%"
                          v-model:value="
                                    taskState.questionRef[`sopQ${String(sopQ.questionId)}`]
                                "
                        >
                          <a-row>
                            <a-col
                              :span="24"
                              v-for="(optionItem, optionIndex) in sopQ.examOption
                                            .split(/[;,]/)
                                            .filter(item => item.trim() !== '')"
                              :key="optionIndex"
                            >
                              <a-radio :style="taskState.radioStyle" :value="optionItem.charAt(0)">
                                {{ optionItem }}
                              </a-radio>
                            </a-col>
                          </a-row>
                        </a-radio-group>
                      </div>
                    </a-col>
                  </a-row>
                </template>
              </div>
            </a-spin>
          </div>
          <a-divider style="margin: 0px; background: #ebebeb" />
          <div class="footer">
            <div class="failed-text">
              该任务考试已失败次数：<span class="count" style="font-size: 16px; color: #ff0000">{{
                taskState.examFailNumber
              }}</span>
            </div>
            <a-button type="primary" @click="handleExam">{{ taskModalText.buttonText }}</a-button>
          </div>
        </a-modal>
        <!--          FAQ-->
        <!--                      修改任务进度-->
        <a-modal v-model:visible="stateG.taskScheduleVisible" centered title="编辑任务进度" @ok="taskScheduleSubmit" @cancel="stateG.taskScheduleVisible = false">
          <a-form ref="taskScheduleRef" :model="stateG.taskScheduleModel">
            <a-form-item name="taskSchedule" label="任务进度" :rules="[{ required: true, message: '请输入任务进度', trigger: 'blur' }]">
              <a-input-number v-model:value="stateG.taskScheduleModel.taskSchedule" :min="0" max="100" :precision="0" style="width: 100%" />
            </a-form-item>
          </a-form>
        </a-modal>
        <!--                      修改任务进度-->
        <!--          风险-->

        <a-modal :visible="stateG.visibleRisk" title="风险" width="80vw" centered destroyOnClose :footer="null" @cancel="stateG.visibleRisk = false">
          <div class="risk-table">
            <a-table
              bordered
              rowKey="taskId"
              :customRow="customRow"
              :columns="stateG.riskColumns"
              :data-source="stateG.riskList"
              :pagination="false"
              :row-class-name="(_record, index) => (index % 2 === 1 ? 'table-striped' : null)"
            >
              <template #bodyCell="{ column, record }">
                <template v-if="column.dataIndex === 'operation'">
                  <a-button type="link" :disabled="record.riskState === '关闭'" @click="handlerBeforeClose(record)"> 关闭 </a-button>
                </template>
              </template>
            </a-table>
          </div>
        </a-modal>
        <!--          风险-->
        <!--          行动项风险-->

        <a-modal :visible="actionFx.visibleRisk" title="行动项任务风险" width="80vw" centered destroyOnClose :footer="null" @cancel="actionFx.visibleRisk = false">
          <div class="risk-table">
            <a-table
              bordered
              rowKey="taskId"
              :columns="actionFx.riskColumns"
              :data-source="actionFx.riskList"
              :pagination="false"
              :row-class-name="(_record, index) => (index % 2 === 1 ? 'table-striped' : null)"
            >
              <!--              <template #bodyCell="{ column, record }">-->
              <!--                <template v-if="column.dataIndex === 'operation'">-->
              <!--                  <a-button type="link" :disabled="record.riskState === '关闭'" @click="handlerBeforeActionClose(record)">关闭</a-button>-->
              <!--                </template>-->
              <!--              </template>-->
            </a-table>
          </div>
        </a-modal>
        <!--          行动项风险-->
        <!--          关闭风险-->
        <a-modal
          :visible="stateG.closeVisible"
          title="关闭风险"
          destroyOnClose
          centered
          width="40%"
          :ok-button-props="{ disabled: btnLoading }"
          @cancel="stateG.closeVisible = false"
          @ok="handlerClose"
        >
          <a-form ref="closeFormRef" :model="closeCurrent">
            <div class="form-content">
              <a-row>
                <a-col :span="24">
                  <a-form-item label="风险关闭备注" name="riskRemarks" :rules="{ required: true, message: '请输入风险关闭备注!' }">
                    <a-textarea v-model:value="closeCurrent.riskRemarks" :rows="5" />
                  </a-form-item>
                </a-col>
              </a-row>
            </div>
          </a-form>
        </a-modal>
        <!--          关闭风险-->
      </a-spin>
      <!--                  sop-->
      <a-modal v-model:visible="sopVisible" title="SOP" :closable="false" :footer="null" :width="1000" :centered="true" :destroyOnClose="true" :keyboard="false" :maskClosable="false">
        <div class="sop-div">
          <div class="one-line-sop">
            <div class="one-left">完成标准</div>
            <div class="one-right">
              <p style="color: #262626; margin: 0" v-for="(item, index) in handlerGetSpace(sopMsg[0].finishStandard)" :key="index">{{ item }}</p>
            </div>
          </div>
          <div class="one-line-sop">
            <div class="one-left">审核标准及注意事项</div>
            <div class="one-right">
              <p style="color: #262626; margin: 0" v-for="(item, index) in handlerGetSpace(sopMsg[0].assessorStandard)" :key="index">{{ item }}</p>
            </div>
          </div>
          <div class="one-line-sop">
            <div class="one-left">SOP</div>
            <div class="one-right">
              <p class="task-dependency">{{ sopMsg[0].taskDependency }}</p>
            </div>
          </div>
          <div class="one-line-sop">
            <div class="one-left">甲方工作事项</div>
            <div class="one-right">
              <p style="color: #262626; margin: 0" v-for="(item, index) in handlerGetSpace(sopMsg[0].taskRemarks)" :key="index">{{ item }}</p>
            </div>
          </div>
          <div class="one-line-sop">
            <div class="one-left">附件模板</div>
            <div class="one-right">
              <a
                v-for="(item, index) in sopMsg[0].attachmentTemplateList"
                :key="index"
                href="javascript:"
                @click="attachmentTemplateDownLoad(item)"
                :class="['block', index > 2 && !sopMsg[0].attachmentShowAll ? 'hide' : '']"
              >
                {{ item.name }}
              </a>
            </div>
          </div>
          <div class="two-line-sop">
            <div class="two-item">
              <div class="two-left">任务负责人</div>
              <div class="two-right">{{ sopMsg[0].taskOwner }}</div>
            </div>
            <div class="two-item">
              <div class="two-left">审核员</div>
              <div class="two-right">{{ sopMsg[0].assessorName }}</div>
            </div>
          </div>
        </div>
        <a-button type="primary" class="sop-btn" @click="sopVisible = false">我已知悉</a-button>
      </a-modal>
      <!--                  结束sop-->
      <!--      确认工时-->
      <a-modal :visible="stateG.confirmVisible" zIndex="1001" title="请确认" @ok="confirmDaily" :ok-button-props="{ loading: stateG.confirmLoading }" centered @cancel="stateG.confirmVisible = false">
        <div
          >本次提交工时：<span class="record-num">{{ stateG.recordForm.workingHours }}工时</span></div
        >
        <div
          >今日提交总工时（含本次提交）：<span class="record-num"
            >{{ Number(stateG.allHours + stateG.recordForm.workingHours)


            }}工时</span
          ></div
        >
      </a-modal>
      <!--      确认工时-->
      <!-- 行动项完成 -->
      <a-modal
        :visible="actionState.actionOkVisible"
        title="完成行动项任务"
        destroyOnClose
        centered
        width="40%"
        @cancel="actionState.actionOkVisible = false"
        @ok="handlerSubAction"
        :ok-button-props="{ loading: actionOkLoading }"
      >
        <div style="margin-bottom: 10px; font-size: 16px; font-weight: 600"> 完成附件证明</div>
        <a-upload :file-list="actionState.fileList" :multiple="true" :before-upload="handlerActionUpload" @remove="handleActionRemove" accept=".xlsx,.ppt,.pdf,.PDF, image/*, .docx, .rp, .xls">
          <a-button type="primary">
            <upload-outlined />
            上传
          </a-button>
        </a-upload>
        <span>支持格式：image/*,.xlsx,.xls,.docx,.rp,.ppt,.pptx,.pdf</span>
      </a-modal>
      <!-- 行动项完成 -->
      <!--                      行动项-风险预警-->
      <a-modal v-model:visible="actionRisk.warrVisible" title="新增任务风险" @ok="actionRiskOk">
        <a-form :model="actionRisk" ref="actionRiskRef">
          <a-row>
            <a-col :span="24">
              <a-form-item label="任务名称" name="taskName" :rules="[{ required: true, message: '请输入任务名称', trigger: 'blur' }]">
                <a-input v-model:value="actionRisk.taskName" disabled />
              </a-form-item>
            </a-col>
            <a-col :span="24">
              <a-form-item label="风险描述" name="riskDescription" :rules="[{ required: true, message: '请输入风险描述', trigger: 'blur' }]">
                <a-input v-model:value="actionRisk.riskDescription" />
              </a-form-item>
            </a-col>
            <a-col :span="24">
              <a-form-item label="解决方案" name="solution" :rules="[{ required: true, message: '请输入解决方案', trigger: 'blur' }]">
                <a-input v-model:value="actionRisk.solution" />
              </a-form-item>
            </a-col>
          </a-row>
        </a-form>
      </a-modal>
      <!--                      行动项-风险预警-->
      <!-- end vid_3jhvgk4byc 自定义模板_o7c8iu8hjy -->
      <!-- begin vid_korwryhwtl 图片_rp2qqhdnrj -->
      <al-image
        v-if="false"
        class="vid_korwryhwtl"
        :emptyImgSrc="''"
        :src="vid_korwryhwtl_props.src"
      />
      <!-- end vid_korwryhwtl 图片_rp2qqhdnrj -->
      <!-- begin vid_bpj7ohcpol 图片_7bjaruk132 -->
      <al-image
        v-if="false"
        class="vid_bpj7ohcpol"
        :emptyImgSrc="''"
        :src="vid_bpj7ohcpol_props.src"
      />
      <!-- end vid_bpj7ohcpol 图片_7bjaruk132 -->
      <!-- begin vid_0mebrpovsq 图片_wqrw0q7gdo -->
      <al-image
        v-if="false"
        class="vid_0mebrpovsq"
        :emptyImgSrc="''"
        :src="vid_0mebrpovsq_props.src"
      />
      <!-- end vid_0mebrpovsq 图片_wqrw0q7gdo -->
    </a-spin>
  </div>
</template>
<script setup lang="tsx">
  import {
      h, ref, reactive, toRaw, markRaw, watch, computed,
      onBeforeMount, onMounted, onBeforeUnmount, onUnmounted, onActivated, onDeactivated
    } from "vue";
    import { useRoute, useRouter } from 'vue-router';
    const router = useRouter();
    const route = useRoute();
    import { get, post, put, del, request, requestWithHeaders } from '@/utils/http/Axios';
    import { cloneDeep, localGet, merge, getDifferenceArray, traversalTreeStructure, checkCaseCondition, renderStringInTemplate, handleBreadcrumbJump, throttle, permission, getComponentParamsValue } from '@/utils/index';
    import { isNullOrEmpty, isEmptyArr, isNullOrUnDef, isContained, isArray, isEmpty, isObject } from '@/utils/is';
    import dayjs from 'dayjs';
    import { getPagePcChartsDataSourceConvert } from '@/utils/chart';
    import { message, notification, Modal } from 'ant-design-vue'
    import { propertyFormatByNumber, propertyFormatByPercentage, propertyFormatByDate, parseSubFromDataList } from '@/utils/format';
    import colorTheme from '@/design/custom-theme.json';
    
    import UserTableRecords from '@/model/UserTableRecords';
    import { getAppBaseUrl } from '@/utils/index';
    import { sendToken } from "@/hooks/useIframeToken";
    import { useSystemStore } from "@/store/modules/system";
    const systemStore = useSystemStore();
    



      // 获取传入的流程ID和组件参数
      const props = defineProps({
            'processInstanceId': {
            type: [String,Number,Boolean],
            default: undefined,
        },
      })
      const immediateWatch = (source, callback) => {
        watch(source, callback, {deep: true,immediate: true })
      }



  /* -------------------------- 属性定义 -------------------------- */

      const setTimeOutList = [];
      const pageLoading = reactive({
        loading: false,
        tip: undefined
      });
      const authInfo = localGet('app-user-store');
// 图片 http://10.40.0.33:9001/file-storage/492423550550370304.png
import vid_korwryhwtl_imageUrl from '@/assets/images/52c83f8adc89cea175aee2eb9d46414b.png'

    const vid_korwryhwtl_props = reactive({
          src: vid_korwryhwtl_imageUrl,
  })
// 图片 http://10.40.0.33:9001/file-storage/492422810635298816.png
import vid_bpj7ohcpol_imageUrl from '@/assets/images/c6ab6b25240bbe839113c7a5f530e729.png'

    const vid_bpj7ohcpol_props = reactive({
          src: vid_bpj7ohcpol_imageUrl,
  })
// 图片 http://10.40.0.33:9001/file-storage/492422872295761920.png
import vid_0mebrpovsq_imageUrl from '@/assets/images/e11ba2261fef98b7463c5a8d95fa242d.png'

    const vid_0mebrpovsq_props = reactive({
          src: vid_0mebrpovsq_imageUrl,
  })



      // 处理校验
      const setSubFormName =(parentInfo, name)=>{
        return [parentInfo.parents, parentInfo.cycleIndex, name];
      }


  /* ========================== 属性定义 ========================== */


  /* -------------------------- 元素数据引用 -------------------------- */


  /* ========================== 元素数据引用 ========================== */


  /* -------------------------- 页面数据 -------------------------- */


  /* ========================== 页面数据 ========================== */



  /* -------------------------- 响应 -------------------------- */

  /* ========================== 响应 ========================== */


  /* -------------------------- 函数 -------------------------- */

  /* ========================== 函数 ========================== */


  /* -------------------------- 页面参数 -------------------------- */

    const pageParameter_state = reactive({
        'processInstanceId': props.processInstanceId ?? route.query.processInstanceId,
    })

  /* ========================== 页面参数 ========================== */


  /* -------------------------- 组件事件处理方法 -------------------------- */

    // ---------------------------- 组件数据同步 ----------------------------

    // ============================ 组件数据同步 ============================


  /* ========================== 组件事件处理方法 ========================== */


  /* -------------------------- 生命周期 -------------------------- */
  // 用于参数变更后重新执行自定义指令
      const queryUpdateFlag = ref(0);
      onMounted(() => { ;

    });

    onUnmounted(() => {
      // 销毁定时器
      setTimeOutList.forEach(({ repeat, timer }) => {
        repeat ?  clearInterval(timer): clearTimeout(timer);
      });
    });

  /* ========================== 生命周期 ========================== */


  /* -------------------------- 数据关联处理 -------------------------- */





  /* -------------------------- 表单数据同步 -------------------------- */
  /* ========================== 表单数据同步 ========================== */

  /* ========================== 数据关联处理 ========================== */


  /* -------------------------- 不同组件自定义的处理逻辑 -------------------------- */

  /* ========================== 不同组件自定义的处理逻辑 ========================== */


  // ================================定制化逻辑========================================
  const pageLoadingG = reactive({
    loading: false,
    tip: '加载中...'
  })
  const checkData = ref({})
  const expandIconPosition = 'right'
  let apiMap = {
    default: '',
    plat: '',
    market: '',
    deliver: ''
  }
  const columnGNew = [
    {
      title: '项目名称',
      dataIndex: 'projectName',
      resizable: false,
      ellipsis: true,
      width: '200px',
      fixed: 'left'
    },
    {
      title: '项目阶段',
      dataIndex: 'milepostName',
      resizable: false,
      ellipsis: true,
      width: '150px',
      fixed: 'left'
    },

    {
      title: '任务名称',
      dataIndex: 'taskName',
      ellipsis: true,
      resizable: false,
      width: '220px',
      fixed: 'left'
    },
    {
      title: '任务状态',
      dataIndex: 'taskStatus',
      resizable: false,
      ellipsis: true,
      width: '140px',
      align: 'center'
    },
    {
      title: '任务进度',
      dataIndex: 'taskSchedule',
      resizable: false,
      ellipsis: true,
      width: '140px',
      align: 'center'
    },
    // {
    //   title: '倒计时及加减分',
    //   dataIndex: 'countDown',
    //   resizable: false,
    //   ellipsis: true,
    //   width: '250px',
    //   align: 'center',
    //   customCell: ({ rowSpan, rowIndex, aa }) => {
    //     return {
    //       style: {
    //         padding: 0
    //       }
    //     }
    //   }
    // },
    {
      title: '是否关联目标',
      dataIndex: 'isAssociatedTarget',
      resizable: false,
      ellipsis: true,
      width: '150px',
      align: 'center'
    },
    {
      title: '任务负责人',
      dataIndex: 'taskOwner',
      resizable: true,
      ellipsis: true,
      width: '140px',
      align: 'center'
    },
    {
      title: '任务执行人',
      resizable: true,
      dataIndex: 'taskParticipant',
      ellipsis: true,
      width: '140px',
      align: 'center'
    },
    {
      title: '审核员',
      dataIndex: 'assessorName',
      resizable: true,
      ellipsis: true,
      width: '140px',
      align: 'center'
    },
    {
      title: '未关闭风险数量',
      dataIndex: 'unclosedRiskNumber',
      resizable: false,
      ellipsis: true,
      width: '150px',
      align: 'center'
      // customCell: ({ rowIndex, rowSpan, aa }) => {
      //   return {
      //     style: {
      //       color: '#3875ff',
      //     }
      //   }
      // }
    },
    {
      title: '计划开始',
      dataIndex: 'startTime',
      resizable: false,
      ellipsis: true,
      width: '140px',
      align: 'center'
    },
    {
      title: '预计开始',
      dataIndex: 'estimatedStartTime',
      resizable: false,
      ellipsis: true,
      width: '140px',
      align: 'center'
    },
    {
      title: '实际开始',
      dataIndex: 'actualStarTime',
      resizable: false,
      ellipsis: true,
      width: '140px',
      align: 'center'
    },
    {
      title: '计划完成',
      dataIndex: 'endTime',
      ellipsis: true,
      width: '120px',
      resizable: false,
      align: 'center'
    },
    {
      title: '预计完成',
      dataIndex: 'estimatedEndTime',
      resizable: false,
      ellipsis: true,
      width: '140px',
      align: 'center'
    },
    {
      title: '	实际完成',
      dataIndex: 'taskFinishTime',
      ellipsis: true,
      resizable: false,
      width: '120px',
      align: 'center'
    },
    {
      title: '实际工时(小时)',
      dataIndex: 'actualWorkHours',
      resizable: false,
      ellipsis: true,
      width: '130px',
      align: 'center'
    },
    {
      title: '工时投入状态',
      dataIndex: 'stateInput',
      resizable: false,
      ellipsis: true,
      width: '120px',
      align: 'center'
    },

    {
      title: '操作',
      dataIndex: 'operation',
      width: '220px',
      align: 'center',
      fixed: 'right'
    }
  ]
  const columnG = [
    {
      title: '项目名称',
      dataIndex: 'projectName',
      resizable: false,
      ellipsis: true,
      width: '200px',
      fixed: 'left'
    },
    {
      title: '项目阶段',
      dataIndex: 'milepostName',
      resizable: false,
      ellipsis: true,
      width: '150px',
      fixed: 'left'
    },

    {
      title: '任务名称',
      dataIndex: 'taskName',
      ellipsis: true,
      resizable: false,
      width: '220px',
      fixed: 'left'
    },
    {
      title: '任务状态',
      dataIndex: 'taskStatus',
      resizable: false,
      ellipsis: true,
      width: '140px',
      align: 'center'
    },
    {
      title: '任务进度',
      dataIndex: 'taskSchedule',
      resizable: false,
      ellipsis: true,
      width: '140px',
      align: 'center'
    },
    // {
    //   title: '倒计时及加减分',
    //   dataIndex: 'countDown',
    //   resizable: false,
    //   ellipsis: true,
    //   width: '250px',
    //   align: 'center',
    //   customCell: ({ rowSpan, rowIndex, aa }) => {
    //     return {
    //       style: {
    //         padding: 0
    //       }
    //     }
    //   }
    // },
    {
      title: '是否关联目标',
      dataIndex: 'isAssociatedTarget',
      resizable: false,
      ellipsis: true,
      width: '150px',
      align: 'center'
    },
    {
      title: '任务负责人',
      dataIndex: 'taskOwner',
      resizable: true,
      ellipsis: true,
      width: '140px',
      align: 'center'
    },
    {
      title: '任务执行人',
      resizable: true,
      dataIndex: 'taskParticipant',
      ellipsis: true,
      width: '140px',
      align: 'center'
    },
    {
      title: '审核员',
      dataIndex: 'assessorName',
      resizable: true,
      ellipsis: true,
      width: '140px',
      align: 'center'
    },
    {
      title: '未关闭风险数量',
      dataIndex: 'unclosedRiskNumber',
      resizable: false,
      ellipsis: true,
      width: '150px',
      align: 'center'
      // customCell: ({ rowIndex, rowSpan, aa }) => {
      //   return {
      //     style: {
      //       color: '#3875ff',
      //     }
      //   }
      // }
    },
    {
      title: '计划开始',
      dataIndex: 'startTime',
      resizable: false,
      ellipsis: true,
      width: '140px',
      align: 'center'
    },
    {
      title: '实际开始',
      dataIndex: 'actualStarTime',
      resizable: false,
      ellipsis: true,
      width: '140px',
      align: 'center'
    },
    {
      title: '计划完成',
      dataIndex: 'endTime',
      ellipsis: true,
      width: '120px',
      resizable: false,
      align: 'center'
    },
    {
      title: '	实际完成',
      dataIndex: 'taskFinishTime',
      ellipsis: true,
      resizable: false,
      width: '120px',
      align: 'center'
    },
    {
      title: '实际工时(小时)',
      dataIndex: 'actualWorkHours',
      resizable: false,
      ellipsis: true,
      width: '130px',
      align: 'center'
    },
    {
      title: '工时投入状态',
      dataIndex: 'stateInput',
      resizable: false,
      ellipsis: true,
      width: '120px',
      align: 'center'
    },

    {
      title: '操作',
      dataIndex: 'operation',
      width: '220px',
      align: 'center',
      fixed: 'right'
    }
  ]
  const columnAction = [
    {
      title: '工厂/项目名称',
      dataIndex: 'projectName',
      resizable: true,
      ellipsis: true,
      width: '140px',
      align: 'left'
      // fixed: 'left',
    },
    {
      title: '项目阶段',
      dataIndex: 'milepostName',
      resizable: true,
      ellipsis: true,
      width: '140px',
      // fixed: 'left',
      align: 'left'
    },

    {
      title: '任务名称',
      dataIndex: 'taskName',
      ellipsis: true,
      resizable: true,
      width: '220px',
      // fixed: 'left',
      align: 'left'
    },
    {
      title: '行动项任务名称',
      dataIndex: 'actionTaskName',
      ellipsis: true,
      resizable: true,
      width: '220px',
      align: 'left'
    },
    {
      title: '任务状态',
      dataIndex: 'taskStatus',
      resizable: true,
      ellipsis: false,
      width: '140px',
      align: 'center'
    },
    {
      title: '任务进度',
      dataIndex: 'taskSchedule',
      resizable: true,
      ellipsis: false,
      width: '140px',
      align: 'center'
    },
    // {
    //   title: '倒计时及加减分',
    //   dataIndex: 'countDown',
    //   resizable: true,
    //   ellipsis: false,
    //   width: '250px',
    //   align: 'center',
    //   customCell: ({ rowSpan, rowIndex, aa }) => {
    //     return {
    //       style: {
    //         padding: 0
    //       }
    //     }
    //   }
    // },
    {
      title: '未关闭风险数量',
      dataIndex: 'unclosedRiskNumber',
      resizable: true,
      ellipsis: false,
      width: '150px',
      align: 'center'
    },
    {
      title: '附件',
      dataIndex: 'ppmEnclosureInfoList',
      resizable: true,
      ellipsis: true,
      width: '200px',
      align: 'center'
    },
    {
      title: '任务负责人',
      dataIndex: 'taskOwner',
      resizable: true,
      ellipsis: true,
      width: '140px',
      align: 'center'
    },
    {
      title: '审核员',
      dataIndex: 'assessorName',
      resizable: true,
      ellipsis: true,
      width: '140px',
      align: 'center'
    },
    {
      title: 'PMO',
      dataIndex: 'projectManagementOffice',
      resizable: true,
      ellipsis: true,
      width: '140px',
      align: 'center'
    },
    {
      title: '任务执行人',
      resizable: true,
      dataIndex: 'taskParticipantListStr',
      ellipsis: true,
      width: '140px',
      align: 'center'
    },
    {
      title: '计划开始',
      dataIndex: 'startTime',
      resizable: true,
      ellipsis: true,
      width: '140px',
      align: 'center'
    },
    {
      title: '实际开始',
      dataIndex: 'examPassTime',
      resizable: true,
      ellipsis: true,
      width: '140px',
      align: 'center'
    },
    {
      title: '计划完成',
      dataIndex: 'endTime',
      ellipsis: true,
      width: '120px',
      resizable: true,
      align: 'center'
    },
    {
      title: '	实际完成',
      dataIndex: 'taskFinishTime',
      ellipsis: true,
      resizable: true,
      width: '120px',
      align: 'center'
    },
    {
      title: '计划工时(小时)',
      dataIndex: 'workingHours',
      resizable: true,
      ellipsis: true,
      width: '130px',
      align: 'center'
    },
    {
      title: '实际工时(小时)',
      dataIndex: 'actualWorkHours',
      resizable: true,
      ellipsis: true,
      width: '130px',
      align: 'center'
    },
    {
      title: '工时投入状态',
      dataIndex: 'stateInput',
      resizable: true,
      ellipsis: true,
      width: '120px',
      align: 'center'
    },
    {
      title: '操作',
      dataIndex: 'operation',
      width: '280px',
      align: 'center',
      fixed: 'right'
    }
  ]
  // const jfColuns = cloneDeep(columnG).filter(column => column.dataIndex !== 'countDown');
  const jfColuns = cloneDeep(columnG)

  const jfmbColuns = cloneDeep(columnG)
  const scColuns = cloneDeep(columnG)
  const columnGd = ref([
    {
      title:'工单标题',
      dataIndex: 'content',
      resizable: true,
      ellipsis: true,
      align: 'center',
    },
    {
      title:'所属父工单标题',
      dataIndex: 'parentContent',
      resizable: true,
      ellipsis: true,
      align: 'center',
    },
    {
      title:'优先级',
      dataIndex: 'priority',
      resizable: true,
      ellipsis: true,
      align: 'center',
    },
    {
      title:'来源',
      dataIndex: 'questionSource',
      resizable: true,
      ellipsis: true,
      align: 'center',
    },
    {
      title:'工单类型',
      dataIndex: 'type',
      resizable: true,
      ellipsis: true,
      align: 'center',
    },
    {
      title:'工单状态',
      dataIndex: 'status',
      resizable: true,
      ellipsis: true,
      align: 'center',
    },
    {
      title:'是否关联目标',
      dataIndex: 'isAssociatedTarget',
      resizable: true,
      ellipsis: true,
      align: 'center',
    },
    {
      title:'创建时间',
      dataIndex: 'createdTime',
      resizable: true,
      ellipsis: true,
      align: 'center',
    },
    {
      title:'实际开始',
      dataIndex: 'actualStartTime',
      resizable: true,
      ellipsis: true,
      align: 'center',
    },
    {
      title:'实际解决时间',
      dataIndex: 'actualFinishTime',
      resizable: true,
      ellipsis: true,
      align: 'center',
    },
    {
      title:'操作',
      dataIndex: 'operation',
      resizable: true,
      ellipsis: true,
      width: '200px',
      align: 'center',
    }
  ])
  const activeKey = ref('IN_PROGRESS')
  const collapseActiveKey = ref(['1', '2', '3', '4', '5', '6','7'])
  const ppmCheckedListLen = ref(0)
  const btnLoading = ref(false)
  const ppmCheckList = ref([])
  const current = ref({})
  // 新-审核标准数据
  const ppmTemplateCheckList = ref([])
  // 新-完成标准数据
  const CompletionCheckListCheckList = ref([])
  // 注意事项
  const ppmCheckedList = ref([])
  const projectType = ref('')
  const stateG = reactive({
    bodyStyle: {
      padding: '24px 24px 0px 24px'
    },
    confirmLoading: false,
    confirmVisible: false,
    dailyType: '',
    isSubmit: false,
    riskNum: 0,
    countdownNum: 0,
    delayNotCompletedNum: 0,
    delayNotStartNum: 0,
    noStartCurrentMonthNum: 0,
    recordVisible: false,
    filter1: undefined,
    filter2: '0',
    NUM: 12,
    allHours: 0,
    recordForm: {
      code: '',
      dailyDate: undefined,
      estimatedTimeOfCompletion: undefined,
      projectCode: undefined,
      solution: undefined,
      taskId: undefined,
      workingHours: undefined,
      risk: '否',
      riskDescription: undefined,
      actionTaskId: undefined,
      dailyType: undefined
    },
    btnLoading: false,
    fileList: [],
    // 交付模板项目
    templateOkVisible: false,
    // 交付模板项目实际完成时间
    actualFinishTime: undefined,
    // 普通交付项目完成弹窗
    okVisible: false,
    //   平台项目完成弹窗
    ptOkVisible: false,
    // 预警弹窗
    warringVisible: false,
    templateRisk: {
      taskId: undefined,
      taskName: undefined,
      riskDescription: undefined,
      milepostId: undefined,
      projectId: undefined,
      solution: undefined
    },
    // 任务进度弹窗
    taskScheduleVisible: false,
    taskScheduleModel: {
      id: undefined,
      taskSchedule: undefined,
      status: undefined
    },
    //   交付任务
    deliveryList: [],
    //   市场任务
    marketList: [],
    //   平台任务
    platList: [],
    //   模板任务
    templateList: [],
    // 工单
    workOrderDtoList:[],
    noTemplateProjectWorkbenchTaskDtoList: [],
    actionTaskWorkbenchTaskDtoList: [],
    visibleRisk: false,
    riskList: [],
    riskColumns: [
      { title: '风险描述', dataIndex: 'riskDescription', width: '170px', align: 'center' },
      { title: '解决方案', dataIndex: 'solution', align: 'center' },
      { title: '风险状态', dataIndex: 'riskState', align: 'center' },
      { title: '提交人', dataIndex: 'reportedBy', align: 'center' },
      { title: '提交时间', dataIndex: 'dailyDate', align: 'center' },
      { title: '解决人', dataIndex: 'closeRiskPerson', align: 'center' },
      { title: '风险关闭备注', dataIndex: 'riskRemarks', align: 'center' }
    ],
    closeVisible: false
  })
  const closeCurrent = ref({
    dailyItemId: undefined,
    riskRemarks: ''
  })
  const closeFormRef = ref()
  const recordRef = ref(null)
  onMounted(() => {
    getTableList()
  })

  function getTableList(status) {
    pageLoading.loading = true
    const params = {
      status: activeKey.value === '全部' ? '' : activeKey.value,
      type: stateG.filter2,
      projectName: stateG.filter1
    }
    post('/solution-ppm/api/v2/built-in-system-ppm/refactoring_task/workbench', params)
      .then(({ data }) => {
        stateG.deliveryList = data.deliveryWorkbenchTaskDtoList
        stateG.marketList = data.marketWorkbenchTaskDtoList
        stateG.platList = data.platformWorkbenchTaskDtoList
        stateG.templateList = data.templateWorkbenchTaskDtoList
        stateG.noTemplateProjectWorkbenchTaskDtoList = data.noTemplateProjectWorkbenchTaskDtoList
        stateG.actionTaskWorkbenchTaskDtoList = data.actionTaskWorkbenchTaskDtoList
        stateG.workOrderDtoList = data.workOrderDtoList
        stateG.riskNum = data.riskBubble
        stateG.countdownNum = data.countdownBubble
        stateG.delayNotCompletedNum = data.delayNotCompletedBubble
        stateG.delayNotStartNum = data.delayNotStartBubble
        stateG.noStartCurrentMonthNum = data.noStartCurrentMonthBubble
      })
      .catch(error => {
        message.error('获取列表数据失败！')
      })
      .finally(() => {
        pageLoading.loading = false
      })
  }

  function tabsChange(key) {
    getTableList()
  }

  function debounce(func, delay) {
    let timeoutId
    return function(...args) {
      clearTimeout(timeoutId)
      timeoutId = setTimeout(() => {
        func.apply(this, args)
      }, delay)
    }
  }

  const inputChange = debounce(function() {
    getTableList()
  }, 500)
  //     平台模板任务逻辑
  const ptTemplateState = reactive({
    createTaskVisible: false,
    editTaskVisible: false,
    okLoading: false,
    createTitle: '',
    modalForm: {},
    selectTypeVisible: false,
    radioValue: '模板任务',
    otherTaskVisible: false,
    otherTaskTitle: '',
    current: 1,

    treeData: [],
    parentListMap: [],
    milepostList: [],

    //   审核标准
    ppmTemplateCheckList:[],
    //   sop
    sopList:[],
    //   完成任务附件
    fileList:[],
    okMbVisible:false,
    otherOkLoading:false
  })
  const currentotherPtTask = ref({})
  //     完成按钮
  function beforeOk(record, flag) {
    // 交付
    if (record.finishPermission == false) {
      message.info('非该任务任务负责人')
    } else if (record.taskStatusOnOrOff == false) {
      message.info('只有开启/上线的任务才能完成任务')
    } else if (record.projectSwitch == 'false') {
      message.info('只有项目开启状态下的任务才能完成')
    } else if (
      (record.taskStatus === '审批中' || record.taskStatus === '延期完成' || record.taskStatus === '完成') &&
      record.delFlag === 0
    ) {
      message.info(`任务状态为${record.taskStatus}的任务无法进行完成操作`)
    } else if (record.isRiskOrNo == true) {
      message.info('该任务包含风险，请关闭风险后重试')
    } else {
      // 新-判断不同项目点击完成时触发动作
      if (flag === '模板项目' && record.dailyType !== 5) {
        console.log(record)
        current.value = record
        const pageType = 'deliver'
        // 新-获取审核标准赋值
        get(
          `/solution-ppm/api/v2/built-in-system-ppm/delivery_task/${current.value.taskId}/standard_info/search`
        ).then(data => {
          ppmTemplateCheckList.value =
            data.data.assessorStandardList?.map(item => {
              return {
                type: item.type,
                selected: false,
                content: item.content
              }
            }) || []
          sopList.value = data.data.sopList
          if (data.data.finishStandard !== null) {
            CompletionCheckListCheckList.value = data.data.finishStandardList
          } else {
            CompletionCheckListCheckList.value = []
          }
          apiMap = {
            default: `/solution-ppm/api/v2/built-in-system-ppm/task/${record.taskId}/queryAttachment`,
            plat: `/solution-ppm/api/v2/built-in-system-ppm/v2/platform/task/attachment/${record.taskId}`,
            market: `/solution-ppm/api/v2/built-in-system-ppm/internalAndMarketTask/${record.taskId}/queryAttachment`,
            deliver: `/solution-ppm/api/v2/built-in-system-ppm/delivery_task/${record.taskId}/queryAttachment`
          }
          get(apiMap[pageType]).then(({ data }) => {
            stateG.fileList = data?.attachment ? JSON.parse(data.attachment) : []
            stateG.templateOkVisible = true
          })
        })
        projectType.value = 'deliver'
      } else if (flag === '交付通用项目' && record.dailyType !== 5) {
        const pageType = 'deliver'
        current.value = record
        apiMap = {
          default: '/solution-ppm/api/v2/built-in-system-ppm/checklist//queryPpmMilepostChecklistMap',
          plat: '/solution-ppm/api/v2/built-in-system-ppm/checklist//queryPpmMilepostChecklistMap',
          market: '/solution-ppm/api/v2/built-in-system-ppm/checklist//queryPpmMilepostChecklistMap',
          deliver: '/solution-ppm/api/v2/built-in-system-ppm/checklist//queryPpmMilepostChecklistMap'
        }
        post(apiMap[pageType], {
          milepostId: current.value.milepostId
        }).then(({ ppmCheckListMap }) => {
          const data = []
          let len = 0
          for (let key in ppmCheckListMap) {
            len += ppmCheckListMap[key].length || 0
            data.push({
              name: key,
              value: ppmCheckListMap[key]
            })
          }
          ppmCheckedList.value = []
          ppmCheckList.value = data
          console.log(ppmCheckListMap, 'ppmCheckListMap')

          get(`/solution-ppm/api/v2/built-in-system-ppm/delivery_task/${record.taskId}/queryAttachment`).then(
            ({ data }) => {
              stateG.fileList = data?.attachment ? JSON.parse(data.attachment) : []
              stateG.okVisible = true
            }
          )
        })
        projectType.value = 'deliver'
      } else if (flag === '平台项目' && record.dailyType !== 5&&!record.isPlatTemplate) {
        const pageType = 'plat'
        current.value = record
        apiMap = {
          default: '/solution-ppm/api/v2/built-in-system-ppm/checklist//queryPpmMilepostChecklistMap',
          plat: '/solution-ppm/api/v2/built-in-system-ppm/checklist//queryPpmMilepostChecklistMap',
          market: '/solution-ppm/api/v2/built-in-system-ppm/checklist//queryPpmMilepostChecklistMap',
          deliver: '/solution-ppm/api/v2/built-in-system-ppm/checklist//queryPpmMilepostChecklistMap'
        }
        post(apiMap[pageType], {
          milepostId: current.value.milepostId
        }).then(({ ppmCheckListMap }) => {
          const data = []
          let len = 0
          for (let key in ppmCheckListMap) {
            len += ppmCheckListMap[key].length || 0
            data.push({
              name: key,
              value: ppmCheckListMap[key]
            })
          }

          ppmCheckedListLen.value = len
          ppmCheckedList.value = []
          ppmCheckList.value = data
          checkData.value = ppmCheckListMap
          get(`/solution-ppm/api/v2/built-in-system-ppm/v2/platform/task/attachment/${record.taskId}`).then(
            ({ data }) => {
              stateG.fileList = data?.attachment ? JSON.parse(data.attachment) : []
              stateG.ptOkVisible = true
            }
          )
        })
        projectType.value = 'plat'
      } else if(flag==='平台项目'&& record.dailyType !== 5&&record.isPlatTemplate){
        currentotherPtTask.value = record
        // 新-获取审核标准赋值
        get(`/solution-ppm/api/v2/built-in-system-ppm/v2/platform/${currentotherPtTask.value.taskId}/assessor_standard_and_sop/search`).then(data => {
          ptTemplateState.ppmTemplateCheckList = data.data.assessorStandardList?.map(item => {
            return {
              type: item.type,
              selected: item.selected,
              content: item.content
            }
          }) || []
          ptTemplateState.sopList = data.data.sopList
          if (data.data.finishStandard !== null) {
            ptTemplateState.CompletionCheckListCheckList = data.data.finishStandardList
          } else {
            ptTemplateState.CompletionCheckListCheckList = []
          }
          get(`/solution-ppm/api/v2/built-in-system-ppm/v2/platform/task/attachment/${record.taskId}`).then(({ data }) => {
            ptTemplateState.fileList = data?.attachment ? JSON.parse(data.attachment) : [];
            ptTemplateState.okMbVisible = true
          })

        })

      }
      else if (flag === '市场项目' && record.dailyType !== 5) {
        const pageType = 'market'
        current.value = record
        apiMap = {
          default: '/solution-ppm/api/v2/built-in-system-ppm/checklist//queryPpmMilepostChecklistMap',
          plat: '/solution-ppm/api/v2/built-in-system-ppm/checklist//queryPpmMilepostChecklistMap',
          market: '/solution-ppm/api/v2/built-in-system-ppm/checklist//queryPpmMilepostChecklistMap',
          deliver: '/solution-ppm/api/v2/built-in-system-ppm/checklist//queryPpmMilepostChecklistMap'
        }
        post(apiMap[pageType], {
          milepostId: current.value.milepostId
        }).then(({ ppmCheckListMap }) => {
          const data = []
          let len = 0
          for (let key in ppmCheckListMap) {
            len += ppmCheckListMap[key].length || 0
            data.push({
              name: key,
              value: ppmCheckListMap[key]
            })
          }

          ppmCheckedListLen.value = len
          ppmCheckedList.value = []
          ppmCheckList.value = data
          get(`/solution-ppm/api/v2/built-in-system-ppm/v2/platform/task/attachment/${record.taskId}`).then(
            ({ data }) => {
              stateG.fileList = data?.attachment ? JSON.parse(data.attachment) : []
              stateG.ptOkVisible = true
            }
          )
        })
        projectType.value = 'market'
      } else if (record.dailyType === 5) {
        if (record.unclosedRiskNumber > 0) {
          message.info('该任务包含风险，请关闭风险后重试')
        } else {
          actionState.current = record
          actionState.actionOkVisible = true
        }
      }
    }
  }

  // 任务下载全部模板
  function downLoadTemplate() {
    if (current.value.attachmentTemplateList.length < 1) {
      message.info('任务没有附件')
    } else {
      post(
        `/solution-ppm/api/v2/built-in-system-ppm/delivery_task/download_template/${current.value.taskId}`,
        null,
        { responseType: 'arraybuffer' }
      ).then(res => {
        downloadZip(res, '任务附件模板.zip')
      })
    }
  }

  // 模板交付项目完成任务
  function handlerTemplateOk() {
    if (!checkAllSelected(CompletionCheckListCheckList.value)) {
      message.info('请确认完成标准及SOP全部已实现')
    } else if (stateG.fileList.length < 1) {
      message.info('请上传附件')
    } else if (!checkAllSelected(sopList.value[0].contentList)) {
      message.info('请确认完成标准及SOP全部已实现')
    } else {
      handlerCheckOk()
    }
  }

  // 模板交付项目完成任务
  function handlerCheckOk() {
    btnLoading.value = true
    const params = {
      form: [],
      sopList: sopList.value,
      taskId: current.value.taskId,
      actualStartTime:stateG.actualFinishTime
    }
    params.form = [...CompletionCheckListCheckList.value, ...ppmTemplateCheckList.value]
    stateG.btnLoading = true
    apiMap = {
      default: '/solution-ppm/api/v2/built-in-system-ppm/task/attachmentUploading',
      plat: '/solution-ppm/api/v2/built-in-system-ppm/v2/platform/task/attachment',
      market: '/solution-ppm/api/v2/built-in-system-ppm/internalAndMarketTask/attachmentUploading',
      deliver: '/solution-ppm/api/v2/built-in-system-ppm/delivery_task/attachmentUploading'
    }
    post(apiMap[projectType.value], {
      ppmEnclosureInfoList: stateG.fileList,
      taskId: current.value.taskId
    }).then(data => {
      if (data.code === 200) {
        post(
          `/solution-ppm/api/v2/built-in-system-ppm/delivery_task/${current.value.taskId}/standard_info/submit`,
          params
        ).then(data => {
          if (data.code === 200) {
            stateG.btnLoading = false
            stateG.templateOkVisible = false
            message.success('操作成功')
            btnLoading.value = false
            getTableList()
          } else {
            btnLoading.value = false
            message.error(data.message)
          }
        })
      } else {
        btnLoading.value = false
        message.error('上传附件失败')
      }
    })
  }

  // 删除附件
  function handleRemove(file) {
    stateG.fileList = stateG.fileList.filter(item => item.uid !== file.uid)
  }
  const uploadingJf = ref(false)
  // 上传附件
  function handlerUpload(file) {
    uploadingJf.value=true
    const data = new FormData()
    data.append('file', file)
    apiMap = {
      default: '/file-storage/api/v1/file/upload',
      plat: '/file-storage/api/v1/file/upload',
      market: '/file-storage/api/v1/file/upload',
      deliver: '/file-storage/api/v1/file/upload'
    }
    post(apiMap[projectType.value], data).then(({ data: { fullUrl } }) => {
      if (data) {
        stateG.fileList = [
          ...stateG.fileList,
          {
            uid: file.uid,
            lastModified: file.lastModified,
            name: file.name,
            size: file.size,
            type: file.type,
            status: 'done',
            url: fullUrl
          }
        ]
      }
    }).finally(() => {
      uploadingJf.value=false
    })
    return false
  }

  // 平台项目检查清单
  function ppmCheckedListChange(value) {
    if (ppmCheckedList.value.includes(value)) {
      ppmCheckedList.value = ppmCheckedList.value.filter(item => item !== value)
    } else {
      ppmCheckedList.value.push(value)
    }
  }

  // 通用交付项目完成提交
  function handlerJfOk() {
    console.log(current.value, 'current.value.')
    if (current.value.output === '是' && stateG.fileList.length < 1) {
      message.info('请上传附件')
    } else {
      stateG.btnLoading = true
      post('/solution-ppm/api/v2/built-in-system-ppm/delivery_task/attachmentUploading', {
        ppmEnclosureInfoList: stateG.fileList,
        taskId: current.value.taskId
      }).then(data => {
        if (data.code === 200) {
          post('/solution-ppm/api/v2/built-in-system-ppm/delivery_task/taskCompletionApprovalFlow', {
            plName: current.value.plName,
            taskId: current.value.taskId
          }).then(data => {
            if (data.code === 200) {
              stateG.btnLoading = false
              stateG.okVisible = false
              getTableList()
              message.success('操作成功')
            } else {
              stateG.btnLoading = false
              message.error('提交失败')
            }
          })
        } else {
          stateG.btnLoading = false
          message.error('上传附件失败')
        }
      })
    }
  }
  const okPtLoading = ref(false)
  //     平台项目完成任务
  function handlerPtOk() {
    if (projectType.value === 'plat') {
      stateG.btnLoading = true
      okPtLoading.value = true
      const fileOk = post('/solution-ppm/api/v2/built-in-system-ppm/v2/platform/task/attachment', {
        ppmEnclosureInfoList: stateG.fileList,
        taskId: current.value.taskId
      })
      const taskOk = put('/solution-ppm/api/v2/built-in-system-ppm/v2/platform/task/status', {
        plName: current.value.plName,
        taskId: current.value.taskId,
        dataList: checkData.value,
        checkListIdList: ppmCheckedList.value
      })

      Promise.all([fileOk, taskOk])
        .then(([fileOkRes, taskOkRes]) => {
          if (fileOkRes.code === 200 && taskOkRes.code === 200) {
            stateG.btnLoading = false
            okPtLoading.value = false
            stateG.ptOkVisible = false
            getTableList()
            message.success('操作成功')
          } else {
            if (fileOkRes.code !== 200) {
              message.error(fileOkRes.message)
            } else if (taskOkRes.code !== 200) {
              message.error(taskOkRes.message)
            }
            stateG.btnLoading = false
            okPtLoading.value = false
            stateG.ptOkVisible = false
          }
        }).finally(() => {
        okPtLoading.value = false
      })
        .catch(error => {
          message.error(error)
        })
    } else if (projectType.value === 'market') {
      stateG.btnLoading = true
      apiMap = {
        default: '/solution-ppm/api/v2/built-in-system-ppm/task/taskCompletionApprovalFlow',
        plat: '/solution-ppm/api/v2/built-in-system-ppm/v2/platform/task/status',
        market: '/solution-ppm/api/v2/built-in-system-ppm/internalAndMarketTask/taskCompletionApprovalFlow',
        deliver: '/solution-ppm/api/v2/built-in-system-ppm/delivery_task/taskCompletionApprovalFlow'
      }
      const taskOk = post(
        '/solution-ppm/api/v2/built-in-system-ppm/internalAndMarketTask/taskCompletionApprovalFlow',
        {
          plName: current.value.plName,
          taskId: current.value.taskId
        }
      )
      const fileOk = post('/solution-ppm/api/v2/built-in-system-ppm/internalAndMarketTask/attachmentUploading', {
        ppmEnclosureInfoList: stateG.fileList,
        taskId: current.value.taskId
      })

      Promise.all([fileOk, taskOk])
        .then(([fileOkRes, taskOkRes]) => {
          if (fileOkRes.code === 200 && taskOkRes.code === 200) {
            stateG.btnLoading = false
            stateG.ptOkVisible = false
            getTableList()
            message.success('操作成功')
          } else {
            if (fileOkRes.code !== 200) {
              message.error(fileOkRes.message)
            } else if (taskOkRes.code !== 200) {
              message.error(taskOkRes.message)
            }
            stateG.btnLoading = false
            stateG.ptOkVisible = false
          }
        })
        .catch(error => {

          message.error(error)
        }).finally(() => {
        stateG.btnLoading = false
      })
    }
  }

  //计算日报填写时间的周六
  function calculateNextSaturday(inputDateStr) {
    // 将输入日期字符串转换为日期对象
    const inputDate = new Date(inputDateStr)

    // 获取输入日期是星期几
    const inputDay = inputDate.getDay()

    // 计算距离本周六的天数
    const daysUntilSaturday = 6 - inputDay

    // 创建一个新日期对象，以输入日期为基准，加上天数以获得本周六的日期
    const nextSaturday = new Date(inputDate)
    nextSaturday.setDate(inputDate.getDate() + daysUntilSaturday)

    // 格式化日期为 "yyyy-mm-dd" 形式
    const formattedDate =
      `${nextSaturday.getFullYear()}-${(nextSaturday.getMonth() + 1).toString().padStart(2, '0')}` +
      `-${nextSaturday.getDate().toString().padStart(2, '0')}`

    return formattedDate
  }

  function changeDate(value) {
    stateG.recordForm.estimatedTimeOfCompletion = calculateNextSaturday(value)
  }

  //     全部项目-风险预警
  function handlerWarning(record) {
    if (record.dailyType === 5) {
      get(`/solution-ppm/api/v2/built-in-system-ppm/action_task/${record.actionTaskId}/start_permission`).then(
        data => {
          if (data.code === 200) {
            console.log(record, 'record')
            actionRisk.warrVisible = true
            actionRisk.taskName = record.actionTaskName
            actionRisk.riskDescription = record.riskDescription
            actionRisk.solution = record.solution
            actionRisk.actionTaskId = record.actionTaskId
            actionRisk.projectId = record.projectId
            actionRisk.milepostId = record.milepostId
          } else {
            message.error('暂无权限进行此操作')
          }
        }
      )
    } else {
      if (record.finishPermission == false) {
        message.info('非该任务任务负责人')
      } else {
        if (record.taskFinishTime !== null) {
          message.info('该任务已完成，此功能已关闭')
        } else {
          stateG.warringVisible = true
          stateG.templateRisk.taskName = record.taskName
          stateG.templateRisk.riskDescription = record.riskDescription
          stateG.templateRisk.solution = record.solution
          stateG.templateRisk.taskId = record.taskId
          stateG.templateRisk.projectId = record.projectId
          stateG.templateRisk.milepostId = record.milepostId
        }
      }
    }
  }

  const templateRiskRef = ref(null)

  //     全部项目-预警保存
  function handleTemplateRiskOk() {
    templateRiskRef.value.validate().then(() => {
      const params = {
        taskId: stateG.templateRisk.taskId,
        projectId: stateG.templateRisk.projectId,
        milepostId: stateG.templateRisk.milepostId,
        riskDescription: stateG.templateRisk.riskDescription,
        solution: stateG.templateRisk.solution
      }
      post('/solution-ppm/api/v2/built-in-system-ppm/refactoring_task/task_warn', params).then(data => {
        if (data.code === 200) {
          message.success('操作成功')
          stateG.warringVisible = false
          getTableList()
        } else {
          message.error(data.message)
        }
      })
    })
  }

  //     FAQ
  //     模板交付项目开始按钮
  const handleStart = record => {
    if (record.finishPermission === false) {
      message.info('暂无权限！非该任务负责人')
    } else {
      if (record.dailyType === 5) {
        actionState.current = record
        put(
          `/solution-ppm/api/v2/built-in-system-ppm/action_task/${actionState.current.actionTaskId}/start`
        ).then(data => {
          if (data.code === 200) {
            message.success('已开始该任务，请及时完成任务')
            getTableList()
          } else {
            message.error('开始任务失败')
          }
        })
      } else {
        get(`/solution-ppm/api/v2/built-in-system-ppm/delivery_task/${record.taskId}/check_condition`).then(data => {
          if (data.code === 200) {
            if (!data.data) {
              message.info('依赖任务未完成，无法开始该任务')
            } else {
              sopId.value = record.taskId
              projectId.value = record.projectId
              taskState.isExam = false
              taskState.currentTaskId = record.taskId
              taskState.examFailNumber = record.examFailNumber || 0
              post(`/solution-ppm/api/v2/built-in-system-ppm/task/faq/study/search`, {
                taskId: taskState.currentTaskId
              }).then(res => {
                if (res.data.taskQuestionFinishStandardList?.length || res.data.taskQuestionSopList?.length) {
                  taskState.sopQList = res.data.taskQuestionSopList
                  taskState.finishQList = res.data.taskQuestionFinishStandardList
                  examsVisible.value = true
                } else {
                  message.success('已开始该任务，请及时完成任务')
                  taskState.currentTaskId = null
                  // 获取表格列表
                  getTableList()
                  getSop()
                }
              })
            }
          }
        })

      }
    }
  }
  // FAQ
  const examsVisible = ref(false)
  const taskState = reactive({
    questionList: [],
    sopQList: [],
    finishQList: [],
    examFailNumber: 0,
    isExam: false,
    currentTaskId: null,
    loading: false,
    questionRef: {},
    radioStyle: {
      display: 'flex',
      height: '30px',
      lineHeight: '30px'
    }
  })
  const taskModalText = computed(() => {
    return taskState.isExam
      ? {
        buttonText: '交卷',
        modalTitle: '考试',
        tipText: '确认学习完成后请您点击考试进行测试，考试不合格将通知项目总监并扣除个人最终绩效分数。'
      }
      : {
        buttonText: '考试',
        modalTitle: '开始学习',
        tipText: '确认学习完成后请您点击考试进行测试，考试不合格将通知项目总监并扣除个人最终绩效分数。'
      }
  })
  const formatText = text => {
    if (!text) {
      return ''
    }
    // 换行
    return text.replace(/\n/g, '<br>')
  }
  const reg1 = /<div[^>]*>([\s\S]*?)<\/div>/

  function handleExam() {
    if (!taskState.isExam) {
      taskState.loading = true
      post(`/solution-ppm/api/v2/built-in-system-ppm/task/faq/exmainee/search`, {
        taskId: taskState.currentTaskId
      }).then(res => {
        taskState.isExam = true
        taskState.loading = false
        const reg = /(?<={).*?(?=})/g
        taskState.sopQList = res.data.taskQuestionSopList
        taskState.finishQList = res.data.taskQuestionFinishStandardList
        // 完成标准
        taskState.finishQList.forEach((finishQ, finishQindex) => {
          const arr = finishQ.examQuestion.match(/\{\}/g) // 匹配空的{}
          if (arr) {
            arr.forEach((match, i) => {
              const replacedQuestion = finishQ.examQuestion.replace(
                match,
                `<div id="finishQ${String(
                  finishQindex
                )}" contenteditable style="font-weight:600;border-bottom: 1px solid #9c9c9c;display:inline-block;min-width:25px;outline: none"></div>`
              )
              taskState.finishQList[finishQindex].examQuestion = replacedQuestion
            })
          }
        })
        //SOP
        taskState.sopQList.forEach((sopQ, sopQindex) => {
          const arr = sopQ.examQuestion.match(/\{\}/g) // 匹配空的{}
          if (arr) {
            arr.forEach((match, i) => {
              const replacedQuestion = sopQ.examQuestion.replace(
                match,
                `<div id="finishQ${String(
                  sopQindex
                )}" contenteditable style="font-weight:600;border-bottom: 1px solid #9c9c9c;display:inline-block;min-width:25px;outline: none"></div>`
              )
              taskState.sopQList[sopQindex].examQuestion = replacedQuestion
            })
          }
        })
      })

      return
    }

    Modal.confirm({
      content: '确认提交吗？',
      onOk: () => {
        // 交卷
        const taskQuestionList = []

        for (const key in taskState.questionRef) {
          const questionId = parseInt(key.match(/\d+/)[0]) // 提取数字部分作为questionId
          const newItem = {
            questionId: questionId,
            answers: taskState.questionRef[key]
          }
          taskQuestionList.push(newItem)
        }
        console.log(taskState.questionRef, 'taskState.questionRef')
        console.log(taskQuestionList, 'taskQuestionList.taskQuestionList')
        put('/solution-ppm/api/v2/built-in-system-ppm/task/faq/exmainee', {
          taskId: taskState.currentTaskId,
          taskQuestionList: taskQuestionList
        }).then(res => {
          if (!res.data) {
            message.error(res.message)
            return
          }
          const message1 =
            res.data.taskExamStatus === '未通过' ? '考试不通过请重新开始学习' : '考试通过，请及时完成任务'
          const icon =
            res.data.taskExamStatus === '未通过'
              ? ''
              : ''
          message.success({
            content: message1,
            duration: 3,
            icon: h('img', { src: icon, style: { display: 'inline-block', marginRight: '10px' } })
          })
          examsVisible.value = false
          taskState.isExam = false
          taskState.currentTaskId = null
          getTableList()
          getSop()
          taskState.questionRef = {}
        })
      }
    })
  }

  //     FAQ
  // 修改任务进度
  function changeTaskSchedule(finishPermission, num, id, status, type) {
    if (type === '其他') {
      if (finishPermission === false) {
        message.info('暂无权限！非该任务负责人')
      } else {
        stateG.taskScheduleVisible = true
        stateG.taskScheduleModel.taskSchedule = num
        stateG.taskScheduleModel.id = id
        stateG.taskScheduleModel.status = status
      }
    }
  }

  //     保存任务进度
  const taskScheduleRef = ref(null)

  function taskScheduleSubmit() {
    if (
      stateG.taskScheduleModel.taskSchedule === 100 &&
      stateG.taskScheduleModel.status !== '完成' &&
      stateG.taskScheduleModel.status !== '延期完成'
    ) {
      message.info('请点击完成按钮进行此操作')
    } else {
      taskScheduleRef.value.validate().then(() => {
        put(
          `/solution-ppm/api/v2/built-in-system-ppm/delivery_task/update/task_schedule/${stateG.taskScheduleModel.id}/${stateG.taskScheduleModel.taskSchedule}`
        ).then(data => {
          if (data.code === 200) {
            message.success('操作成功')
            getTableList()
            stateG.taskScheduleVisible = false
          } else {
            message.info(data.message)
            stateG.taskScheduleVisible = false
          }
        })
      })
    }
  }

  //     倒计时

  const calculateTimeDifference = targetDate => {
    const targetDateTime = new Date(targetDate)
    const currentDateTime = new Date()
    const timeDifference = targetDateTime - currentDateTime
    const days = Math.floor(timeDifference / (1000 * 60 * 60 * 24))

    return {
      days: days,
      result: `${days}天${Math.floor((timeDifference % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60))}小时`
    }
  }

  function shouldDisplayCountDownWithTooltip(labelList, text) {
    const result = labelList?.filter(label => label.includes(text))
    if (result && result.length > 0) {
      return [true, result[0]]
    } else {
      return false
    }
  }

  function hasHyphen(str) {
    return str.includes('-')
  }

  function hasPlus(str) {
    return str.includes('+')
  }

  function splitStringByColon(inputString) {
    return inputString.split(':')
  }

  const shouldDisplayCountDown = targetDate => {
    const { days } = calculateTimeDifference(targetDate)
    return days >= 0 && days <= 7
  }
  const scrollX = columnG.reduce((pre, cur) => {
    return parseInt(pre.width) + parseInt(cur.width)
  }, {})
  const scrolljfX = jfColuns.reduce((pre, cur) => {
    return parseInt(pre.width) + parseInt(cur.width)
  }, {})
  const scrolljfmbX = jfmbColuns.reduce((pre, cur) => {
    return parseInt(pre.width) + parseInt(cur.width)
  }, {})
  const scrollscX = scColuns.reduce((pre, cur) => {
    return parseInt(pre.width) + parseInt(cur.width)
  }, {})

  //     未关闭风险
  function handlerShowRisks(flag, record, type = '全部') {
    if (record.dailyType !== 5) {
      if (flag === '平台') {
        projectType.value = 'plat'
      } else if (flag === '交付' || flag === '模板') {
        projectType.value = 'deliver'
      } else if (flag === '市场') {
        projectType.value = 'market'
      }

      apiMap = {
        default: `/solution-ppm/api/v2/built-in-system-ppm/daily/${record.taskId}/${type}queryRi/skList`,
        plat: `/solution-ppm/api/v2/built-in-system-ppm/daily/${record.taskId}/${type}/queryRiskList`,
        market: `/solution-ppm/api/v2/built-in-system-ppm/daily/${record.taskId}/${type}/queryRiskList`,
        deliver: `/solution-ppm/api/v2/built-in-system-ppm/daily/${record.taskId}/${type}/queryRiskList`
      }
      get(apiMap[projectType.value]).then(({ dataList }) => {
        stateG.riskList = dataList
        stateG.visibleRisk = true
      })
    } else {
      post(`/solution-ppm/api/v2/built-in-system-ppm/action_task/warn_list/${record.actionTaskId}`).then(data => {
        actionFx.riskList = data.data
        actionFx.current.actionTaskId = record.actionTaskId
        actionFx.visibleRisk = true
      })
    }
  }

  const actionFx = reactive({
    current: {},
    visibleRisk: false,
    riskList: [],
    riskColumns: [
      { title: '风险描述', dataIndex: 'riskDescription', width: '300px', align: 'center' },
      { title: '解决方案', dataIndex: 'solution', align: 'center' },
      { title: '风险状态', dataIndex: 'riskState', align: 'center' },
      { title: '提交人', dataIndex: 'createdBy', align: 'center' },
      { title: '提交时间', dataIndex: 'createdTime', align: 'center' },
      { title: '解决人', dataIndex: 'solver', align: 'center' },
      { title: '风险关闭备注', dataIndex: 'riskRemarks', align: 'center' }
      // { title: '操作', dataIndex: 'operation', align: 'center' }
    ]
  })

  //     关闭风险
  function handlerBeforeClose(record) {
    if (record.disablePermission === 'false') {
      message.info('暂无权限')
    } else {
      closeCurrent.value = {
        dailyItemId: record.dailyItemId,
        riskRemarks: '',
        taskId: record.taskId
      }
      stateG.closeVisible = true
    }
  }


  function handlerClose() {
    closeFormRef.value.validate().then(() => {
      btnLoading.value = true
      apiMap = {
        default: '/solution-ppm/api/v2/built-in-system-ppm/daily/updateRiskState',
        plat: '/solution-ppm/api/v2/built-in-system-ppm/daily/updateRiskState',
        market: '/solution-ppm/api/v2/built-in-system-ppm/daily/updateRiskState',
        deliver: '/solution-ppm/api/v2/built-in-system-ppm/daily/updateRiskState'
      }
      post(apiMap[projectType.value], closeCurrent.value)
        .then(({ code, message: errMsg }) => {
          if (code === 200) {
            stateG.closeVisible = false
            handlerShowRisks(closeCurrent.value)
            message.success('操作成功')
          } else {
            message.warning(errMsg || '操作失败')
          }
        })
        .finally(() => {
          btnLoading.value = false
        })
    })
  }

  // 写日报
  function writeDaily(record) {
    if (record.dailySwitch == false) {
      message.info('暂无法填写日报')
    } else {
      // 日报对应日期
      const formattedDate = dayjs().format('YYYY-MM-DD')
      stateG.recordForm.dailyDate = formattedDate
      post('/solution-ppm/api/v2/built-in-system-ppm/daily_report/for_create', {
        dailyDate: stateG.recordForm.dailyDate
      }).then(data => {
        console.log(record)
        stateG.allHours = data.data.workHours
        // stateG.dailyType = record.dailyType
        stateG.recordForm.projectCode = record.projectCode
        stateG.recordForm.dailyType = record.dailyType
        stateG.recordForm.actionTaskId = record.actionTaskId
        stateG.recordForm.milepostId = record.milepostId
        stateG.recordForm.taskId = record.taskId
        stateG.recordForm.code = record.projectId
        stateG.recordForm.workingHours = undefined
        stateG.recordVisible = true
      })
    }
  }
  // 跳工单
  function jumpGd(record){
    window.open(`${import.meta.env.VITE_PUBLIC_PATH}/allin-app/app_3000000079/page/3000001111?name=${record.content}`, '_blank')
  }


  //     提交日报
  function confirmDailyRecord(flag) {
    recordRef.value.validate().then(() => {
      stateG.isSubmit = flag
      if (flag === false) {
        confirmDaily()
      } else {
        stateG.confirmVisible = true
      }
    })
  }

  function recordCancel() {
    stateG.recordVisible = false
  }

  function confirmDaily() {
    stateG.confirmLoading = true
    let params = {
      dailyType: stateG.dailyType,
      dailyDate: stateG.recordForm.dailyDate,
      ppmDailyItems: [stateG.recordForm],
      isSubmit: stateG.isSubmit === true ? stateG.isSubmit : false
    }
    console.log(params)
    post('/solution-ppm/api/v2/built-in-system-ppm/daily/add/PpmDaily', params).then(data => {
      if (data.code === 200) {
        if (stateG.isSubmit) {
          message.success('提交成功')
          stateG.confirmVisible = false
          stateG.confirmLoading = false
        } else {
          message.success('保存成功，请在我的日报页面进行提交')
          stateG.confirmVisible = false
          stateG.confirmLoading = false
        }

        stateG.recordVisible = false
        stateG.recordForm = {
          code: '',
          dailyContent: '',
          dailyDate: undefined,
          estimatedTimeOfCompletion: undefined,
          projectCode: undefined,
          solution: undefined,
          taskId: undefined,
          workingHours: undefined,
          risk: '否',
          eventStatus: '正常推进中',
          riskDescription: undefined
        }
      } else {
        message.error(data.message)
        stateG.confirmLoading = false
      }
    })
  }

  function handleTaskResizeColumn(w, col) {
    col.width = Number(w)
  }

  //     下载模板zip
  function downloadZip(response, name) {
    const blob = new Blob([response], { type: 'application/zip;charset=utf-8' })
    const downloadElement = document.createElement('a')
    const href = window.URL.createObjectURL(blob)
    downloadElement.href = href
    downloadElement.download = name // 下载后文件名
    document.body.appendChild(downloadElement)
    downloadElement.click()
    document.body.removeChild(downloadElement)
    window.URL.revokeObjectURL(href)
    return href
  }

  const expandText4 = computed(() => {
    return collapseActiveKey.value.includes('4') ? '折叠' : '展开'
  })
  const expandText3 = computed(() => {
    return collapseActiveKey.value.includes('3') ? '折叠' : '展开'
  })
  const expandText2 = computed(() => {
    return collapseActiveKey.value.includes('2') ? '折叠' : '展开'
  })
  const expandText1 = computed(() => {
    return collapseActiveKey.value.includes('1') ? '折叠' : '展开'
  })
  const expandText5 = computed(() => {
    return collapseActiveKey.value.includes('5') ? '折叠' : '展开'
  })
  const expandText6 = computed(() => {
    return collapseActiveKey.value.includes('6') ? '折叠' : '展开'
  })
  const expandText7 = computed(() => {
    return collapseActiveKey.value.includes('7') ? '折叠' : '展开'
  })
  // SOP
  // SOP
  const sopId = ref(null)

  function getSop() {
    const params = {
      taskName: '',
      endTime: '',
      taskOwner: '',
      taskStatusOnOrOff: 'true',
      taskStatusList: [],
      stateInput: '',
      priorityStr: '',
      milepostId: '',
      projectId: projectId.value,
      taskId: sopId.value
    }
    post('/solution-ppm/api/v2/built-in-system-ppm/delivery_task/search', params).then(data => {
      if (data.code === 200) {
        sopMsg.value = [data.data[0]] || []
        sopVisible.value = true
      } else {
        message.error('获取任务详情失败')
      }
    })
  }

  const sopVisible = ref(false)
  const sopMsg = ref([])
  const projectId = ref(null)

  // 新-模板项目审核标准格式
  function handlerGetSpace(data) {
    return data?.split(/[,;；]/)
  }

  // 模板项目附件模板下载
  function attachmentTemplateDownLoad(item) {
    const props = { ...item }
    let xhr = new XMLHttpRequest()
    xhr.open('GET', props.url, true)
    xhr.responseType = 'blob'
    xhr.onload = function() {
      if (xhr.status === 200) {
        if (window.navigator.msSaveOrOpenBlob) {
          navigator.msSaveBlob(xhr.response, props.name)
        } else {
          let link = document.createElement('a')
          let body = document.querySelector('body')
          link.href = window.URL.createObjectURL(xhr.response)
          link.download = props.name
          // fix Firefox
          link.style.display = 'none'
          body.appendChild(link)
          link.click()
          body.removeChild(link)
          window.URL.revokeObjectURL(link.href)
        }
      }
    }
    xhr.send()
  }

  // SOP

  //新完成任务弹窗内容
  function formatContent(content) {
    // 将内容分割成多行
    const lines = content.split('；')
    // 将每一行包裹在 p 标签中并返回
    return lines.map(line => `<p>${line.trim()}</p>`).join('')
  }

  const sopList = ref([])

  function handleSubmitSop() {
    const params = {
      form: [],
      sopList: sopList.value,
      taskId: current.value.taskId
    }
    params.form = [...CompletionCheckListCheckList.value]
    post('/solution-ppm/api/v2/built-in-system-ppm/delivery_task/save_standard_sop', params).then(() => {
      message.success('操作成功')
      stateG.templateOkVisible = false
      getTableList()
    })
  }

  //新完成任务弹窗内容
  //标签浮窗表格
  // tooltip样式
  const labelToolStyle = {
    maxWidth: '1000px'
  }
  const labelCoulmn = [
    {
      title: '加减分类型',
      width: 120,
      dataIndex: 'pointTypeName'
    },
    {
      title: '加减分数',
      width: 100,
      dataIndex: 'taskPoints'
    },
    {
      title: '加减分触发日期',
      width: 200,
      dataIndex: 'updateTime'
    },
    {
      title: '是否扣分',
      width: 120,
      dataIndex: 'deductStatus'
    },
    {
      title: '审批日期',
      width: 200,
      dataIndex: 'taskRectificationPointsTime'
    },
    {
      title: '是否绩效结算',
      width: 200,
      dataIndex: 'settlementView'
    },
  ]

  function getScore(arr) {
    let sum = 0
    if (arr) {
      arr.forEach(item => {
        if (item.deductStatus === '是') {
          sum += item.taskPoints || 0 // 如果 taskPoints 为 null 或者 undefined，将其视为 0
        }
      })
    }
    return sum.toFixed(2)
  }

  function checkAllSelected(content) {
    for (let i = 0; i < content.length; i++) {
      if (!content[i].selected) {
        return false // 只要有一个 selected 不为 true，就返回 false
      }
    }
    return true // 如果所有的 selected 都为 true，返回 true
  }

  const actionState = reactive({
    fileList: [],
    current: {},
    actionOkVisible: false,
    actionList: [],
    addOrEditActionVisible: false,
    treeData: [],
    isproject: false
  })
  const actionOkLoading = ref(false)

  // 完成行动项
  function handlerSubAction() {
    if (actionState.fileList.length < 1) {
      message.error('请上传附件')
    } else {
      actionOkLoading.value = true
      put(`/solution-ppm/api/v2//built-in-system-ppm/action_task/${actionState.current.actionTaskId}/complete`, {
        ppmEnclosureInfoList: actionState.fileList
      })
        .then(data => {
          if (data.code === 200) {
            message.success('操作成功')
            actionState.actionOkVisible = false
            actionState.fileList = []
            getTableList()
          } else {
            message.error('完成失败')
          }
        })
        .finally(() => {
          actionOkLoading.value = false
        })
    }
  }

  function handlerActionUpload(file) {
    const data = new FormData()
    data.append('file', file)
    post('/file-storage/api/v1/file/upload', data).then(({ data: { fullUrl } }) => {
      if (data) {
        actionState.fileList = [
          ...actionState.fileList,
          {
            uid: file.uid,
            lastModified: file.lastModified,
            name: file.name,
            size: file.size,
            type: file.type,
            status: 'done',
            url: fullUrl
          }
        ]
      }
    })
    return false
  }

  function handleActionRemove(file) {
    actionState.fileList = actionState.fileList.filter(item => item.uid !== file.uid)
  }

  // 新行动项预警
  const actionRisk = reactive({
    warrVisible: false,
    taskName: undefined,
    solution: undefined,
    actionTaskId: undefined,
    projectId: undefined,
    milepostId: undefined
  })

  // 模板项目-风险预警
  function warningAction(record) {
    get(`/solution-ppm/api/v2/built-in-system-ppm/action_task/${record.actionTaskId}/start_permission`).then(
      data => {
        if (data.code === 200) {
          console.log(record, 'record')
          actionRisk.warrVisible = true
          actionRisk.taskName = record.actionTaskName
          actionRisk.riskDescription = record.riskDescription
          actionRisk.solution = record.solution
          actionRisk.actionTaskId = record.actionTaskId
          actionRisk.projectId = record.projectId
          actionRisk.milepostId = record.milepostId
        } else {
          message.error('暂无权限进行此操作')
        }
      }
    )
  }

  // 行动项预警
  const actionRiskRef = ref(null)

  function actionRiskOk() {
    actionRiskRef.value.validate().then(() => {
      const params = {
        actionTaskId: actionRisk.actionTaskId,
        projectId: actionRisk.projectId,
        milepostId: actionRisk.milepostId,
        riskDescription: actionRisk.riskDescription,
        solution: actionRisk.solution
      }
      console.log(params, 'params')
      post('/solution-ppm/api/v2/built-in-system-ppm/action_task/warn', params).then(data => {
        if (data.code === 200) {
          message.success('操作成功')
          actionRisk.warrVisible = false
          getTableList()
        } else {
          message.error(data.message)
        }
      })
    })
  }

  //     编辑行动项
  const okLoading = ref(false)

  function handleSubmitAction() {
    let params = Object.values(actionState.actionList).map(item => ({
      ...item,
      startTime: item.allTime[0],
      endTime: item.allTime[1],
      projectTreeFormList: selectedObjects.value
    }))
    //   编辑
    put(
      `/solution-ppm/api/v2/built-in-system-ppm/action_task/${actionState.current.actionTaskId}/update`,
      params[0]
    )
      .then(data => {
        if (data.code === 200) {
          message.success('编辑成功')
          actionState.addOrEditActionVisible = false
          actionState.isproject = false
          getTableList()
        } else {
          message.error(data.message)
        }
      })
      .finally(() => {
        okLoading.value = false
      })
  }

  function actionStateCancel() {
    console.log('关闭')
    actionState.addOrEditActionVisible = false
  }

  // const treeChange = () => {
  //   if (actionState.actionList[0].projectName.length == 1) {
  //     // 判断是否是项目
  //     post(
  //       `/solution-ppm/api/v2/built-in-system-ppm/action_task/check`,
  //       actionState.actionList[0].projectName
  //     ).then(data => {
  //       actionState.isproject = data.data
  //       if (actionState.isproject) {
  //         getActionMilepostList(actionState.actionList[0].projectName[0])
  //       }
  //
  //     })
  //   }else{
  //     actionState.isproject = false
  //   }
  // }
  const treeChange = () => {
    actionState.actionList[0].milepostId = undefined
    actionState.actionList[0].taskId = undefined
    post(`/solution-ppm/api/v2/built-in-system-ppm/action_task/check`, [
      actionState.actionList[0].projectName
    ]).then(data => {
      actionState.isproject = data.data
      if (actionState.isproject) {
        getActionMilepostList(actionState.actionList[0].projectName)
      }
    })
  }

  // 获取项目阶段
  function getActionMilepostList(id) {
    get(`/solution-ppm/api/v2/built-in-system-ppm/delivery_milepost/${id}/milepost_name/list`).then(data => {
      actionState.milepostList = data.data.dataList
    })
  }

  const selectedObjects = computed(() => {
    const findNode = (nodes, value) => {
      for (let node of nodes) {
        if (node.projectId === value) {
          return { projectName: node.projectName, projectId: node.projectId, nodeType: node.nodeType }
        }
        if (node.children) {
          const result = findNode(node.children, value)
          if (result) {
            return result
          }
        }
      }
      return null
    }

    if (!actionState.actionList || !actionState.actionList[0] || !actionState.treeData) {
      return []
    }

    const projectNameValue = actionState.actionList[0].projectName

    if (!projectNameValue) {
      return []
    }

    // 将单一值转换为数组来处理
    const projectNameArray = Array.isArray(projectNameValue) ? projectNameValue : [projectNameValue]

    return projectNameArray.map(value => findNode(actionState.treeData, value)).filter(item => item !== null)
  })

  // 获取树
  function getTree() {
    get('/solution-ppm/api/v2/built-in-system-ppm/action_task/project_tree').then(data => {
      actionState.treeData = data.data
    })
  }

  function handlerEditAction(record) {
    const cleepData = cloneDeep(record)
    console.log(cleepData);
    getTree()
    actionState.actionList = []
    actionState.title = '编辑行动项任务'
    cleepData.projectName = cleepData.projectTreeFormList
    if (cleepData.milepostId) {
      actionState.isproject = true
      getActionMilepostList(cleepData.projectTreeFormList[0])
      getActionTask(cleepData.milepostId)
    }
    actionState.current = cleepData
    cleepData.allTime = [cleepData.startTime, cleepData.endTime]
    actionState.actionList.push(cleepData)

    actionState.addOrEditActionVisible = true
  }

  function actionMchange(index) {
    actionState.actionList[index].taskId = undefined
  }

  // 根据项目阶段查任务
  function getActionTask(id) {
    post('/solution-ppm/api/v2/built-in-system-ppm/action_task/task_list', {
      milepostId: id
    }).then(data => {
      actionState.taskList = data.data
    })
  }

  const peopleList = ref([])

  // 交付参与人s所有人
  function getAllJfPeople() {
    get('/solution-ppm/api/v2/built-in-system-ppm/pmgf/get/allUser').then(({ data }) => {
      peopleList.value = data.userDtoList.map(item => {
        return {
          label: item.name,
          value: item.name
        }
      })
    })
  }

  getAllJfPeople()
  // 加减分详情弹窗
  const scoreState = reactive({
    visible: false,
    scoreData: [],
    type: ''
  })

  function showScore(data, type) {
    console.log(data, type)
    scoreState.visible = true
    scoreState.scoreData = groupByBusinessDate(data)
    console.log(scoreState.scoreData, '格式化的分数')
    scoreState.type = type
  }

  function groupByBusinessDate(list, key = 'businessDate') {
    const grouped = list.reduce((acc, item) => {
      const groupKey = item[key];
      if (!acc[groupKey]) {
        acc[groupKey] = {
          month: groupKey,
          data: []
        };
      }
      acc[groupKey].data.push(item);
      return acc;
    }, {});

    return Object.values(grouped);
  }

  function calculateTotalTaskPoints(data) {
    let totalTaskPoints = 0;

    data.forEach(monthData => {
      monthData.data.forEach(record => {
        if (record.deductStatus === "是") {
          // 确保 taskPoints 是数字，并累加到 totalTaskPoints
          const taskPoints = parseFloat(record.taskPoints);
          if (!isNaN(taskPoints)) {
            totalTaskPoints += taskPoints;
          }
        }
      });
    });

    // 返回保留两位小数的结果
    return parseFloat(totalTaskPoints.toFixed(2));
  }

  // 弹窗审批状态
  const statuState = reactive({
    visible: false,
    list: []
  })

  function getTaskStatus(id, type) {
    get(`/solution-ppm/api/v2/built-in-system-ppm/refactoring_task/task_approval_detail/${id}/${type}    `).then(
      data => {
        if (data.code !== 200) {
          message.error(data.message)
          return
        }
        statuState.visible = true
        statuState.list = data.data
      }
    )
  }

  const getIconStatus = status => {
    if (status === 'finish') {
      return 'finish'
    } else if (status === 'process') {
      return 'process'
    } else {
      return 'error'
    }
  }
  // 任务下载全部模板
  function downLoadPtMbTemplate() {
    if (currentotherPtTask.value.attachmentTemplateList.length < 1) {
      message.info('任务没有附件')
    } else {
      post(`/solution-ppm/api/v2/built-in-system-ppm/delivery_task/download_template/${currentotherPtTask.value.taskId}`, null, { responseType: 'arraybuffer' }).then(res => {
        downloadZip(res, '任务附件模板.zip');
      })
    }


  }
  // 完成任务
  // 新-新模板项目检查清单确认事件
  function handlerPtMbTemplateOk() {
   if(!checkAllSelected(ptTemplateState.sopList[0].contentList)){
      message.info('请确认完成标准及SOP全部已实现');
    }else{
      handlerPtMbCheckOk();
    }
  }

  const templateOkDisabled = ref(false)
  function handlerPtMbCheckOk() {
    templateOkDisabled.value = true
    const params = {
      form: [],
      sopList:ptTemplateState.sopList,
      taskId:currentotherPtTask.value.taskId
    }
    params.form = [...ptTemplateState.CompletionCheckListCheckList,...ptTemplateState.ppmTemplateCheckList]
    post('/solution-ppm/api/v2/built-in-system-ppm/v2/platform/task/attachment', {
      ppmEnclosureInfoList: ptTemplateState.fileList,
      taskId: currentotherPtTask.value.taskId
    }).then(data=>{
      if(data.code===200){
        post('/solution-ppm/api/v2/built-in-system-ppm/delivery_task/save_standard_sop',params).then(()=>{
          if(data.code===200){
            put("/solution-ppm/api/v2/built-in-system-ppm/v2/platform/task/status", {
              taskId: currentotherPtTask.value.taskId})
              .then(data=>{
                if(data.code!==200){
                  message.error(data.message)
                  templateOkDisabled.value = false
                  return

                }
                templateOkDisabled.value  = false;
                ptTemplateState.okMbVisible = false;
                message.success("操作成功");
              }).finally(()=>{
              templateOkDisabled.value  = false;
            })

          }else{
            message.error('提交失败')
            templateOkDisabled.value = false
          }
        })
      }else{
        templateOkDisabled.value = false
        message.error('附件上传失败')
      }
    })

  }
  const uploadingPt = ref(false)
  function handlerUploadWc(file) {
    uploadingPt.value = true
    const data = new FormData()
    data.append('file', file)

    post('/file-storage/api/v1/file/upload', data).then(({ data: { fullUrl } }) => {
      if (data) {
        ptTemplateState.fileList = [
          ...ptTemplateState.fileList,
          {
            uid: file.uid,
            lastModified: file.lastModified,
            name: file.name,
            size: file.size,
            type: file.type,
            status: 'done',
            url: fullUrl
          }
        ]
      }
    }).finally(() => {
      uploadingPt.value = false
    })
    return false
  }

  function handleRemoveWc(file) {
    ptTemplateState.fileList = ptTemplateState.fileList.filter(item => item.uid !== file.uid)
  }
  // 暂存sop
  function handleSubmitPtSop(){
    const params = {
      form: [],
      sopList:ptTemplateState.sopList,
      taskId:currentotherPtTask.value.taskId
    }
    params.form = [...ptTemplateState.CompletionCheckListCheckList,...ptTemplateState.ppmTemplateCheckList]
    post('/solution-ppm/api/v2/built-in-system-ppm/delivery_task/save_standard_sop',params).then(()=>{
      message.success('操作成功')
      ptTemplateState.okMbVisible = false
      getTableList()
    })
  }
  // 开始
  const startLoading = ref(false)
  function handleOpen(record){
    if(record.instanceId){
      message.info('请审批完成后再开始任务')
      return
    }
    put(`/solution-ppm/api/v2/built-in-system-ppm/refactoring_task/start_task/${record.taskId}`).then(data=>{
      if(data.code!==200){
        message.error(data.message)
        return
      }
      message.success(data.message)
      getTableList()
    }).finally(()=>{
    })
  }
  // 开始
  // 新修改
  const newState = reactive({
    showVisible:false,
    newTitle:'',
    content:''
  })
  function showTotal(msg,title){
    newState.showVisible = true
    newState.newTitle = title
    newState.content = msg
  }
  // --------------------------------FQA,培训----------------------------------------
  const faqVisible = ref(false)
  const faqColumns = ref([
    {
      title: '问题归类',
      dataIndex: 'problemClassifyName',
      align: 'center',
      resizable: true,
      width: 180,
      customCell: item => {
        const { aSpan } = item
        return {
          rowSpan: aSpan
        }
      }
    },
    {
      title: '序号',
      dataIndex: 'problemHappensNo',
      align: 'center',
      resizable: true,
      width: 180,
      customCell: item => {
        const { bSpan } = item
        return {
          rowSpan: bSpan
        }
      }
    },
    {
      title: '出现问题',
      dataIndex: 'problemHappensName',
      align: 'center',
      resizable: true,
      width: 180,
      customCell: item => {
        const { bSpan } = item
        return {
          rowSpan: bSpan
        }
      }
    },
    {
      title: '项目阶段',
      dataIndex: 'problemHappensStage',

      align: 'center',
      resizable: true,
      width: 180,
      customCell: item => {
        const { bSpan } = item
        return {
          rowSpan: bSpan
        }
      }
    },
    {
      title: '原因编号',
      dataIndex: 'flowNo',
      align: 'center',
      resizable: true,
      width: 180
    },
    {
      title: '生产流程标签',
      dataIndex: 'flowLabel',

      align: 'center',
      resizable: true,
      width: 180
    },
    {
      title: '可能原因',
      dataIndex: 'flowReason',
      align: 'center',
      resizable: true,
      width: 180
    },
    {
      title: '解决方案',
      dataIndex: 'flowSolution',

      align: 'center',
      resizable: true,
      width: 180
    },
    {
      title: '主责方',
      dataIndex: 'flowResponsibleParty',

      align: 'center',
      resizable: true,
      width: 180
    },
    {
      title: '主责部门',
      dataIndex: 'flowResponsibleDepartment',

      align: 'center',
      resizable: true,
      width: 180
    },
    {
      title: '典型案例',
      dataIndex: 'flowClassicCase',
      align: 'center',
      resizable: true,
      width: 180
    }
  ])
  const faqDataSource = ref([])
  function faqModelFun(data) {
    faqVisible.value = true

    get(`/solution-ppm/api/v2/built-in-system-ppm/delivery_task/get_milepost_faq/${data}`).then(data => {
      if (data.code !== 200) {
        message.error(data.message)
        return
      }

      faqDataSource.value = groupData2(data.data)

    })
  }
  function faqVisibleCancel(){
    faqVisible.value = false
  }
  function groupData2(data) {
    let currentClassifyId = ''
    let currenrHappensId = ''

    return data.map((item, index) => {
      if (currentClassifyId !== item.classifyId) {
        currentClassifyId = item.classifyId
        item.aSpan = calculateSpan(data, index, 'classifyId', currentClassifyId)
      } else {
        item.aSpan = 0
      }

      if (currenrHappensId !== item.happensId) {
        currenrHappensId = item.happensId
        item.bSpan = calculateSpan(data, index, 'happensId', currenrHappensId)
      } else {
        item.bSpan = 0
      }

      return item
    })
  }

  function calculateSpan(data, index, property, value) {
    let span = 0
    for (let i = index; i < data.length; i++) {
      if (data[i][property] === value) {
        span += 1
      } else {
        break
      }
    }
    return span
  }

  // --------------------------------FQA,培训，end-----------------------------------
  // 培训考试
  const pxksType = ref('')
  const pxState = reactive({
    title:'',
    videoVisble: false,
    pxTableLoading: false,
    videoSrc: '',
    columns:[
      {
        title: '课程名称',
        dataIndex: 'name',
        align: 'center',
        ellipsis: true,
        resizable: true,
        width: 280,
      },
      {
        title: '课程说明',
        dataIndex: 'description',
        align: 'center',
        ellipsis: true,
        resizable: true,
        width: 280,
      },
      {
        title: '课程文件',
        dataIndex: 'file',
        align: 'center',
        resizable: true,
        width: 300,
        visible: computed(() => pxksType.value==='培训')
      },
      {
        title: '视频文件',
        dataIndex: 'videoName',
        align: 'center',
        resizable: true,
        width: 300,
        visible: computed(() => pxksType.value==='培训')
      },
      {
        title: '考试链接',
        dataIndex: 'examLink',
        align: 'center',
        resizable: true,
        width: 300,
        visible: computed(() => pxksType.value==='考试')
      },
    ],
    dataSource:[],
    visible:false
  })
  const filteredPxksColumns = computed(() => {
    return pxState.columns
      .map(column => {
        const updatedColumn = {
          ...column
        }
        return updatedColumn.visible === false ? null : updatedColumn
      })
      .filter(Boolean)
  })
  function showKspx(id,type){
    pxksType.value = type
    pxState.title = type
    get(`/solution-ppm/api/v2/built-in-system-ppm/delivery_task/get_milepost_train/${id}`).then(data=>{
      if (data.code !== 200) {
        message.error(data.message)
        return
      }
      pxState.dataSource = data.data||[]
      pxState.visible = true
    })
  }
  function handlerGetSpace1(data) {
    return data ? data.split(/[,，;；\n]/).map(item => item.trim()) : []
  }
  import TCPlayer from 'tcplayer.js'
  import 'tcplayer.js/dist/tcplayer.min.css'
  let player = ref(null) // 在外部作用域声明播放器实例
  function showVideo(record) {
    console.log(record)
    pxState.videoVisble = true
    pxState.videoSrc = record
    nextTick(() => {
      localStorage.setItem('ghostWatermarkFirstShow', 0)
      let userInfo = localStorage.getItem('al__USER_INFO')
      console.log(JSON.parse(userInfo).value)
      let userName = JSON.parse(userInfo).value.name
      player.value = TCPlayer('video01', {
        sources: [
          {
            src: pxState.videoSrc // 播放地址
          }
        ],
        licenseUrl: 'https://license.vod2.myqcloud.com/license/v2/1309773370_1/v_cube.license', // license 地址，参考准备工作部分，在视立方控制台申请 license 后可获得 licenseUrl
        plugins: {
          DynamicWatermark: {
            //
            type: 'text',
            speed: 0.3, // 建议取值范围 0<= speed <=1，默认值 0.2
            content: `研究院版权所有（${userName}正在播放）`, // 添加换行符
            opacity: 0.5,
            fontSize: '12px', // type === text 时有效, 其余字段通用
            color: '#FFFFFF'
          }
        }
      })
    })
  }
  function closeVideo() {
    player.value?.dispose()
    pxState.videoVisble = false // 关闭弹窗
  }
  const isVideo = (fileType) => {
    // 判断文件类型是否为视频
    return /^video\//.test(fileType);
  };
  // 培训考试
  // 新修改
</script>
<style lang="less" scoped>
  .page_root {
  width: 100%;
  height: 100%;
  overflow: auto;
  }
  .page_root :deep(.@{ant-prefix}-spin-nested-loading),
  .page_root :deep(.@{ant-prefix}-spin-container)
   {
      height: 100%;
  }
  .page_root :deep(.@{ant-prefix}-spin-container .@{ant-prefix}-table-wrapper)
   {
      display: flex;
      flex-flow: column nowrap;
      justify-content: flex-start;
  }
  .page_root :deep(.@{ant-prefix}-table)
   {
    flex: auto;
    overflow: auto;
  }
  .table-moreBtn_down {
    overflow: hidden; white-space: nowrap; text-overflow: ellipsis; width: 100px;
  }

  .table-moreBtn_menu :deep(.table-moreBtn_menu-item):hover {
    background: #ebf1ff;
  }

  /*  表格树结构样式处理，展开按钮层级增加*/
  :deep(.@{ant-prefix}-table-row-expand-icon) {
    z-index: 1;
  }
  /*  表格树结构 由于每个表格项采用自定义组件，使用绝对定位布局，开启树结构导致显示异常，暂时使用层级定位位置 */
  :deep(.@{ant-prefix}-table-row-level-1 .@{ant-prefix}-table-cell-with-append .cell-wrapper-left) {
    left: 15px !important;
    width: calc(100% - 15px);
  }
  :deep(.@{ant-prefix}-table-row-level-2 .@{ant-prefix}-table-cell-with-append .cell-wrapper-left) {
    left: 30px !important;
    width: calc(100% - 30px);
  }
  :deep(.@{ant-prefix}-table-row-level-3 .@{ant-prefix}-table-cell-with-append .cell-wrapper-left) {
    left: 45px !important;
    width: calc(100% - 45px);
  }
  :deep(.@{ant-prefix}-table-row-level-4 .@{ant-prefix}-table-cell-with-append .cell-wrapper-left) {
    left: 60px !important;
    width: calc(100% - 60px);
  }

  /* 穿梭框改变默认样式，为根据组件样式控制左右栏宽度。 */
  :deep(.@{ant-prefix}-transfer-list)
   {
      height: 100%;
      width: 50%;
  }


  .page_root {
    background-color: #fff;
  }

  .gzt-page {
    padding: 16px 20px 20px 20px;
    height: 100%;
    position: relative;
    overflow: auto;
  }

  .gzt-search {
    height: 48px;
    display: flex;
    justify-content: end;
  }

  .search-right {
    width: 40%;
    display: flex;
    justify-content: end;
  }

  .search-left {
    flex: 1;
  }

  .left-icon {
    display: inline-block;
    margin-right: 5px;
    margin-top: 4px;
  }

  .left-content {
    width: 330px;
    height: 32px;
    background: #fdf0cc;
    border-radius: 2px;
    font-size: 14px;
    color: #262626;
    line-height: 32px;
    display: flex;
    padding: 0 16px;
  }

  .search-input {
    height: 32px;
    width: 232px;
    margin-right: 16px;
  }

  .search-radio {
    width: 265px;
  }

  :deep(.ant3-collapse-item) {
    margin-bottom: 16px;
  }

  :deep(.ant3-collapse-icon-position-right > .ant3-collapse-item > .ant3-collapse-header) {
    border-radius: 4px;
    color: #3875ff;
    border-color: #3875ff !important;
  }

  :deep(.ant3-radio-button-wrapper-checked:not([class*=' ant3-radio-button-wrapper-disabled'])) {
    background: #3875ff !important;
    border-radius: 4px; /* 设置所有角的border-radius为4px */
    border-top-right-radius: 0; /* 设置右上角的border-radius为0 */
    border-bottom-right-radius: 0; /* 设置右下角的border-radius为0 */

    color: #fff;
    border-color: #3875ff !important;
  }


  :deep(.ant3-radio-button-wrapper-checked:not([class*=' ant3-radio-button-wrapper-disabled'])):nth-child(3) {
    background: #3875ff !important;
    border-radius: 4px; /* 设置所有角的border-radius为4px */
    border-top-left-radius: 0; /* 设置右上角的border-radius为0 */
    border-bottom-left-radius: 0; /* 设置右下角的border-radius为0 */

    color: #fff;
    border-color: #3875ff !important;
  }

  :deep(.ant3-radio-button-wrapper) {
    border-radius: 4px;
  }

  :deep(.one-line .ant3-form-item-control, .one-line .aps-form-item-control) {
    max-width: unset !important;
  }

  :deep(.ant3-collapse-header) {
    padding: 0 !important;
    border: none !important;
  }

  :deep(.ant3-collapse-borderless > .ant3-collapse-item > .ant3-collapse-content > .ant3-collapse-content-box) {
    padding: 0 !important;
  }

  .collapse-title {
    line-height: 40px;
    width: 100%;
    height: 40px;
    background-image: linear-gradient(270deg, rgba(56, 117, 255, 0) 0%, rgba(56, 117, 255, 0.2) 100%);
    box-shadow: inset 4px 0 0 0 #3875ff;
    border-left: 1px solid #3875ff;
  }

  .gzt-table-box {
    margin-top: 16px;
  }

  .gzt-task-title {
    margin-left: 16px;
    font-family: PingFangSC-Semibold;
    font-size: 18px;
    color: #262626;
    letter-spacing: 0;
    line-height: 25px;
    font-weight: 600;
  }

  .gzt-task-num {
    font-family: PingFangSC-Regular;
    font-size: 16px;
    color: #262626;
    letter-spacing: 0;
    line-height: 25px;
    font-weight: 400;
  }

  .gzt-main {
    overflow: auto;
  }

  /*FAQ*/
  .exam-wrapper .tips {
    margin: 16px 24px 10px;
    background: rgba(250, 173, 20, 0.1);
    height: 36px;
    line-height: 36px;
    padding-left: 16px;
    font-size: 14px;
    color: #282828;
    width: 672px;
  }

  .exam-wrapper .tips.exam {
    height: 56px;
    line-height: 20px;
  }

  .exam-wrapper .icon {
    display: inline-block;
    margin-right: 8px;
    vertical-align: middle;
  }

  .exam-wrapper :deep(.@{ant-prefix}-spin-container) {
    padding-top: 5px;
  }

  .exam-wrapper .content-wrapper {
    margin: 0 24px 16px;
    width: 672px;
    overflow: auto;
    user-select: none;
  }

  .exam-wrapper .section {
    width: 660px;
    margin: 0 auto 16px;
    padding: 16px;
    font-size: 14px;
    background: #ffffff;
    box-shadow: 0 0 6px #e4e4e4;
    border-radius: 2px;
  }

  .exam-wrapper .content-wrapper::-webkit-scrollbar {
    width: 6px;
  }

  .exam-wrapper .section::-webkit-scrollbar {
    width: 2px;
  }

  .exam-wrapper .h1-title {
    margin-bottom: 10px;
    font-size: 16px;
    color: #f5222d;
    font-weight: 600;
  }

  .exam-wrapper .h2-title {
    font-size: 14px;
    color: #262626;
    margin-bottom: 4px;
  }

  .exam-wrapper .h2-title b {
    display: inline-block;
    width: 86px;
    text-align: right;
  }

  .exam-wrapper .article {
    color: #262626;
    margin-bottom: 5px;
    line-height: 20px;
    padding-left: 10px;
  }

  .exam-wrapper .table {
    border: 1px solid rgba(56, 117, 255, 1);
    border-radius: 4px;
    font-size: 14px;
    color: #595959;
    margin-top: 16px;
    display: flex !important;
  }

  .exam-wrapper .table .sub-title {
    border-bottom: 1px solid rgba(56, 117, 255, 0.5);
    height: 32px;
    text-align: center;
    color: #3875ff;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .exam-wrapper .table .title {
    border-bottom: 1px solid rgba(56, 117, 255, 0.5);
    border-right: 1px solid rgba(56, 117, 255, 0.5);
    min-height: 32px;
    text-align: right;
    padding-right: 8px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
  }

  .exam-wrapper .table .content {
    border-bottom: 1px solid rgba(56, 117, 255, 0.5);
    min-height: 32px;
    text-align: left;
    padding: 4px 0px 2px 8px;
  }

  .exam-wrapper .table .content .option {
    display: inline-block;
    min-width: 100px;
  }

  .exam-wrapper .table .no-border {
    border-bottom: none;
  }

  .exam-wrapper .question {
    outline: none !important;
    display: inline;
  }

  /*FAQ*/
  /deep/ .gzt-table-box .ant3-table-thead > tr > th,
  /deep/ .ant3-table-thead > tr > th,
  /deep/ .aps-table-thead > tr > th {
    background-color: #3875ff;
    color: #fff;
    font-weight: 600;
    padding: 8px 16px;
    border-bottom: 1px solid #3875ff;
  }

  :deep(
                  .gzt-table-box
                      .ant3-table.ant3-table-bordered
                      > .ant3-table-container
                      > .ant3-table-body
                      > table
                      > tbody
                      > tr
                      > td
              ) {
    border: 1px solid #d9d9d9;
    color: #262626;
    border-left: none;
  }

  :deep(.gzt-table-box .ant3-table-tbody td),
  :deep(.gzt-page .aps-table-tbody td),
  :deep(.gzt-page .ant3-table-tbody td) {
    padding: 0 16px;
  }

  .risk-table :deep(.ant3-table-tbody td) {
    padding: 6px 16px !important;
  }

  :deep(.gzt-table-box .ant3-table-tbody tr) {
    line-height: 22px;
    height: 40px;
  }

  :deep(.ant3-table-tbody td),
  :deep(.gzt-table-box .ant3-table-tbody td) {
    padding: 0 16px;
  }

  /deep/ .table-striped td {
    background-color: #fafafa;
  }

  .wqd-btn,
  .yq-btn,
  .wc-btn,
  .yqwc-btn,
  .jxz-btn,
  .spz-btn {
    background: #ffffff;
    border-radius: 2px;
    font-family: PingFangSC-Regular;
    font-size: 14px;
    letter-spacing: 0;
    text-align: center;
    line-height: 40px;
    font-weight: 400;
    width: 66px;
    height: 22px;
    line-height: 22px;
    margin: 0 auto;
  }

  .wc-btn {
    border: 1px solid rgba(48, 191, 120, 1);
    color: #30bf78;
  }

  .yq-btn {
    border: 1px solid rgba(224, 32, 32, 1);
    color: #e02020;
  }

  .wqd-btn {
    border: 1px solid rgba(140, 140, 140, 1);
    color: #8c8c8c;
  }

  .jxz-btn {
    border: 1px solid rgba(56, 117, 255, 1);
    color: #3875ff;
  }

  .yqwc-btn {
    border: 1px solid rgba(255, 152, 70, 1);
    color: #ff9846;
  }

  .spz-btn {
    border: 1px solid #00b4ec;
    color: #00b4ec;
  }

  .task-name {
    position: relative;
    height: 40px;
    line-height: 40px;
  }

  .task-milestone {
    position: absolute;
    top: 13px;
    left: 9px;
    width: 45px;
    height: 14px;
    font-size: 12px;
    line-height: 14px; /* 与高度相同 */
    color: #3875ff;
    background: #EBF1FF;
    text-align: center;
  }

  .task-first {
    position: absolute;
    top: 13px;
    left: 16px;
    width: 32px;
    height: 14px;
    background-image: url('@/assets/images/323d370d1ad33c170193f9f229fc11b1.png');
    background-size: cover;
  }

  .task-over {
    position: absolute;
    top: 13px;
    left: 16px;
    width: 32px;
    height: 14px;
    background-image: url('@/assets/images/fa6561569af1852779db3c70ce2cd4b6.png');
    background-size: cover;
  }

  .is-first {
    margin-left: 55px;
  }

  .is-first-no {
    margin-left: 0px;
  }

  .task-name-title {
    display: inlie-block;
    min-width: 50px;
  }

  .finish-standard {
    display: inlie-block;
    min-width: 70px;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
  }

  .no-first {
    margin-left: 20px;
  }

  .checkbox-group {
    margin: 10px 0;
    white-space: normal;
  }

  .checkbox-group .label {
    font-size: 16px;
    line-height: 1.4em;
    color: #3875ff;
    border-left: 6px solid #3875ff;
    text-indent: 8px;
    margin: 8px 0;
  }


  .checkbox-group :deep(.aps-checkbox-wrapper + .aps-checkbox-wrapper),
  .checkbox-group :deep(.ant3-checkbox-wrapper + .ant3-checkbox-wrapper) {
    margin-left: 0;
  }

  .tab-father {
    position: relative;
  }

  .tab-son {
    height: 18px;
    width: 18px;
    position: absolute;
    top: -12px;
    right: -12px;
    background-color: #f5222d;
    color: white;
    border-radius: 50%;
    font-size: 12px;
    text-align: center;
  }

  .icon-tip {
    position: absolute;
    right: -30px;
    top: 0;
  }

  .title-main {
    display: flex;
    justify-content: space-between;
    width: 100%;
  }

  .expand {
    width: 30px;
    font-size: 14px;
    color: #3875ff;
    letter-spacing: 0;
    font-weight: 400;
    margin-right: 30px;
    line-height: 40px;
  }

  .no-data {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 300px;
    height: 150px;
    transform: translate(-50%, -50%);
    background-image: url('@/assets/images/eaf6b5e4041ad3049dc8148d88e8d86e.png');
    background-size: cover;
  }

  .no-tip {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 16px;
  }

  .footer {
    margin: 16px 24px;
    position: relative;
    text-align: center;
  }

  .footer .failed-text {
    position: absolute;
    left: 0;
    font-size: 14px;
    color: #595959;
  }

  /* 倒计时 */
  .count-down {
    border-radius: 1px;
    background: rgba(255, 123, 0, 0.10);
    color: #FF7B00;
    height: 14px;
    min-width: 52%;
    margin-right: 3px;
    margin-bottom: 3px;
  }

  /* 全组 */
  .weight-num {
    font-weight: 600;
  }

  .all-group-yes {
    border-radius: 1px;
    background: rgba(48, 191, 120, 0.10);
    color: #30BF78;
    height: 14px;
    width: 52%;
    line-height: 14px;
    margin-right: 3px;
    margin-bottom: 3px;
  }

  /* 项目经理 */
  .pm-score-yes {
    border-radius: 1px;
    background: rgba(48, 191, 120, 0.10);
    color: #30BF78;
    height: 14px;
    line-height: 14px;
    margin-right: 3px;
    width: 45%;
    margin-bottom: 3px;
  }

  /* 负责人 */
  .ower-score-yes {
    border-radius: 1px;
    background: rgba(48, 191, 120, 0.10);
    color: #30BF78;
    height: 14px;
    line-height: 14px;
    width: 50%;
    margin-right: 2px;
  }

  .all-group-no {
    border-radius: 1px;
    background: rgba(245, 34, 45, 0.10);
    color: #F5222D;
    height: 14px;
    width: 44%;
    line-height: 14px;
    margin-bottom: 3px;
    margin-right: 3px;
  }

  /* 项目经理 */
  .pm-score-no {
    border-radius: 1px;
    background: rgba(245, 34, 45, 0.10);
    color: #F5222D;
    height: 14px;
    line-height: 14px;
    margin-right: 3px;
    width: 45%;
  }

  /* 负责人 */
  .ower-score-no {
    border-radius: 1px;
    background: rgba(245, 34, 45, 0.10);
    color: #F5222D;
    height: 14px;
    line-height: 14px;
    width: 50%;
    margin-right: 2px;
  }


  .count-down-hover {
    color: #262626;
  }

  .count-down-hover > p {
    margin: 0;
  }

  .attachment-template {
    display: block;
    overflow-x: auto; /* 允许横向滚动 */
    overflow-y: hidden; /* 隐藏垂直滚动条 */
    scrollbar-width: thin; /* Firefox 64+ */
    scrollbar-color: transparent transparent; /* Firefox 64+ */
  }

  .attachment-template::-webkit-scrollbar {
    height: 0px; /* 谷歌、Safari、Edge等浏览器 */
  }

  .attachment-template::-webkit-scrollbar-thumb {
    background-color: transparent; /* 设置滚动条的颜色为透明 */
  }

  .extension-color {
    border-radius: 1px;
    background: rgba(89, 89, 89, 0.10);
    color: #595959;
    height: 14px;
    min-width: 51%;
    margin-right: 3px;
    margin-bottom: 3px;
  }

  .count-down-content {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
    padding: 0 5px;
  }

  .count-down-content > div {
    box-sizing: border-box;
    height: 14px;
    text-align: center;
    line-height: 14px;
    font-size: 12px;
  }

  .checkbox-group {
    margin: 10px 0;
    white-space: normal;
  }

  .checkbox-group .label {
    font-size: 16px;
    line-height: 1.4em;
    color: #3875ff;
    border-left: 6px solid #3875ff;
    text-indent: 8px;
    margin: 8px 0;
  }

  .new-check .label {
    font-size: 16px;
    line-height: 1.4em;
    color: #3875ff;
    border-left: 6px solid #3875ff;
    text-indent: 8px;
    margin: 8px 0;
  }

  .checkbox-group label {
    width: 100%;
  }

  /*
        SOP
        */
  .task-dependency {
    white-space: pre-wrap;
  }

  .sop-btn {
    position: absolute;
    left: 50%;
    bottom: 16px;
    transform: translateX(-50%);
  }

  .no-sop {
    background-image: url('@/assets/images/eaf6b5e4041ad3049dc8148d88e8d86e.png');
    background-size: cover;
    position: absolute;
    top: 50%;
    left: 50%;
    width: 150px;
    height: 75px;
    transform: translate(-50%, -50%);
  }

  .no-sop-tip {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 14px;
  }

  .one-line-sop {
    display: flex;
    min-height: 40px;
    line-height: 40px;
    border: 1px solid #afc8ff;
  }

  .one-left {
    background-color: #ebf1ff;
    width: 150px;
    padding: 0 7px;
    text-align: right;
  }

  .one-right {
    padding: 0 7px;
    flex: 1;
    border-left: 1px solid #afc8ff;
  }

  .one-line-sop,
  .two-line-sop {
    font-family: PingFangSC-Regular;
    font-size: 14px;
    color: #262626;
    letter-spacing: 0;
    font-weight: 400;
  }

  .two-line-sop {
    border: 1px solid #afc8ff;
    display: flex;
    height: 40px;
    line-height: 40px;
  }

  .two-item {
    display: flex;
    width: 50%;
  }

  .two-left {
    padding: 0 7px;
    text-align: right;
    width: 150px;
    background-color: #ebf1ff;
  }

  .two-right {
    border-left: 1px solid #afc8ff;
    border-right: 1px solid #afc8ff;
    flex: 1;
    padding: 0 7px;
  }

  .text-bold {
    font-family: PingFangSC-Semibold;
    font-size: 14px;
    color: #262626;
    letter-spacing: 0;
    font-weight: 600;
  }

  .sop-div {
    min-height: 300px;
    max-height: 650px;
    overflow: auto;
    margin-bottom: 40px;
  }

  /*
        SOP
        */
  /*
        倒计时新
        */


  .score-table :deep(.@{ant-prefix}-table-thead) > tr > th {
    background: #F8FAFC;
    font-size: 14px;
    font-family: arial, helvetica, 'microsoft yahei';
    font-weight: 600;
    color: #595959;
    padding: 8px 16px;
    border: none;
  }

  .score-title {
    margin: 12px 2px;
    font-family: PingFangSC-Medium;
    font-size: 16px;
    color: #262626;
    letter-spacing: 0;
    font-weight: 500;
  }

  .vid_7l57iwltcr {
    overflow-y: hidden;
  }

  /*关键路径*/
  .critical-path {
    position: absolute;
    top: 13px;
    left: 5px;
    font-size: 12px;
    width: 60px;
    height: 14px;
    line-height: 14px; /* 与高度相同 */
    color: #FF9846;
    background: #FFF5ED;
    text-align: center;
  }

  .task-milestone-right {
    left: 70px;
  }

  .is-first-path {
    margin-left: 115px;
  }

  .task-first-right {
    position: absolute;
    top: 13px;
    left: 70px;
    width: 32px;
    height: 14px;
    background-image: url('@/assets/images/323d370d1ad33c170193f9f229fc11b1.png');
    background-size: cover;
  }

  .task-over-right {
    position: absolute;
    top: 13px;
    left: 70px;
    width: 32px;
    height: 14px;
    background-image: url('@/assets/images/fa6561569af1852779db3c70ce2cd4b6.png');
    background-size: cover;
  }

  .is-first-path-no-mark {
    margin-left: 70px;
  }

  .title-new {
    display: flex;
    height: 48px;
    line-height: 46px;
    padding: 0 24px;
    margin-bottom: 16px;
    background-image: url('@/assets/images/58c734f4b9c6ff67fa492e06cca46921.png');
    background-size: cover;
    border: 1px solid #3875ff;
    border-radius: 5px;
  }

  .now-img {
    margin-top: 14px;
    margin-right: 3px;
    height: 18px;
    width: 18px;
    background-image: url("@/assets/images/b5cf186e262e6335ff0b39b143d56867.png");
    background-size: cover;
  }

  .today-img {
    margin-top: 14px;
    margin-right: 3px;
    height: 18px;
    width: 18px;
    background-image: url("@/assets/images/0d7f23869f5dd0927f4682fa49009d32.png");
    background-size: cover;
  }

  /deep/ .form-content-action .ant3-form-item-label {
    width: 115px;
  }

  :deep(.ant3-select-selection-item) {
    max-width: 250px;
  }

  .score-title-first {
    background: rgba(250, 173, 20, 0.10);
    color: #262626;
    height: 36px;
    line-height: 36px;
    padding: 0 16px;
  }

  .score-title {
    font-size: 16px;
    color: #262626;
    font-weight: 600;
    margin: 18px 0;
  }

  .score-num {
    font-size: 18px;
    color: #3875ff;
    font-weight: 600;
  }

  .score-num-red {
    color: #F5222D;
    font-weight: 600;
  }

  .score-month {
    font-size: 16px;
    color: #262626;
    letter-spacing: 0;
    font-weight: 400;
    margin-bottom: 12px;
  }

  .month-score {
    font-size: 16px;
    color: #595959;
    letter-spacing: 0;
    font-weight: 400;
    display: inline-block;
    margin-left: 24px;
  }

  .default-score {
    font-size: 16px;
    color: #262626;
    letter-spacing: 0;
    font-weight: 500;
  }

  .score-table :deep(.@{ant-prefix}-table-thead) > tr > th {
    background: #3875ff;
    font-size: 14px;
    font-family: arial, helvetica, 'microsoft yahei';
    font-weight: 600;
    color: #fff;
    padding: 8px 16px;
    border: none;
  }

  .score-table :deep(.@{ant-prefix}-table-tbody) tr > td {
    font-size: 14px;
    font-family: arial, helvetica, 'microsoft yahei';
    font-weight: 400;
    color: #262626;
    padding: 8px 16px;
    border-bottom: 1px solid #d9d9d9;
    word-break: break-all;
  }

  .count-down-content {
    cursor: pointer;
  }

  .record-num {
    color: #3875ff;
    margin-right: 50px;
    font-size: 16px;
    font-weight: 600;
  }

  /*样式*/

  .title-new-status {
    height: 62px;
    line-height: 36px;
    padding: 0 16px;
    margin-bottom: 16px;
    background-image: url('@/assets/images/18c5598e33c9488e1925bf0bd3b80ebb.png');
    background-size: cover;
    border: 1px solid #3875ff;
    border-radius: 5px;
  }

  :deep(.ant3-steps-item-container) {
    padding: 0 16px;
  }

  :deep(.ant3-steps-item-tail::after) {
    margin-left: 12px;
    background-color: #3875ff;
  }

  :deep(.ant3-steps-item-description) {
    font-size: 12px;
    color: #595959;
    text-align: left;
    line-height: 20px;
    font-weight: 400;
  }

  :deep(.ant3-steps-item-icon) {
    width: 24px;
    height: 24px;
    line-height: 24px;
    color: #3875ff;
    margin-top: 6px;
  }

  :deep(.ant3-steps-item-title) {
    height: 28px;
    font-size: 14px;
    color: #262626;
    text-align: left;
    line-height: 22px;
    font-weight: 400;
  }

  :deep(.ant3-steps-item-process > .ant3-steps-item-container > .ant3-steps-item-icon) {
    background-color: #3875ff;
  }

  :deep(.ant3-steps-vertical > .ant3-steps-item > .ant3-steps-item-container > .ant3-steps-item-tail::after) {
    background: #3875ff;
  }

  :deep(.status-step .ant3-steps-vertical > .ant3-steps-item .ant3-steps-item-icon) {
    border-color: #3875ff;
  }

  :deep(.ant3-steps-item-finish .ant3-steps-item-icon > .ant3-steps-icon) {
    color: #3875ff !important;
  }

  .task-status-new {
    cursor: pointer;
  }

  .left-title,
  .right-title {
    font-size: 14px;
    color: rgba(0, 0, 0, 0.65);
    letter-spacing: 0;
    text-align: left;
    font-weight: 400;
    height: 31px;
    line-height: 31px;
  }

  .weight-status {
    font-size: 14px;
    color: #262626;
    letter-spacing: 0;
    font-weight: 500;
  }

  .batch-line {
    width: 100%;
    border-top: 1px solid #d9d9d9;
    margin: 16px 0;
  }

  .weight-status-new {
    font-weight: 600;
    color: #262626;
  }
  .top-main-out{
    display: flex;
    gap:16px;
    margin: 10px 0;
    border-radius: 2px;
    height: 112px;
  }
  .target-div{
    background: rgba(56,144,255,0.10);
    border-radius: 4px;
    padding: 8px 16px;
    border: 1px solid #3875ff;
    width: 50%;
  }
  .opration-btn{
    width:84px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
  }
  .target-content {
    width: 100%;
    border: 1px solid #D9D9D9;
    border-radius: 2px;
    min-height: 34px;
    word-wrap: break-word; /* 强制换行 */
    overflow-wrap: break-word; /* 支持较旧浏览器 */
    white-space: pre-wrap; /* 保持换行符 */
    max-height: 88px; /* 最大高度为 88px */
    overflow-y: hidden; /* 超出部分隐藏 */
    text-overflow: ellipsis; /* 超过最大高度时显示省略号 */
    display: -webkit-box; /* 必须使用这个来实现多行省略号 */
    -webkit-line-clamp: 3; /* 控制显示的行数，3 行后省略 */
    -webkit-box-orient: vertical; /* 必须设置 */
    word-break: break-all; /* 允许长单词/URL换行 */
  }


  .target-title{
    font-size: 14px;
    color: #595959;
    letter-spacing: 0;
    font-weight: 400;
    margin:5px 0;
  }
  .target-title{
    display: flex;
  }
  .target-img,.road-img{
    width:16px;
    height:16px;
    margin-right: 4px;
  }
  .target-img{
    background-image: url('@/assets/images/522f1f6d43c60a7cb798b89ba91735b1.png');
    background-size: cover;
    position: relative;
    top:2px;
  }
  .road-img{
    background-image: url('@/assets/images/a91895c81cac14a33e92d4c374d9e3a2.png');
    background-size: cover;
  }
  .target-content{
    border:none;
  }
  .top-btn-msg{
    display: flex;
    justify-content: space-between;
  }
  .right-btn{
    font-size: 14px;
    color: #3875FF;
    letter-spacing: 0;
    text-align: right;
    font-weight: 400;
    cursor: pointer;
  }
  .btn1,.btn2,.btn3{
    background-image: linear-gradient(90deg, #3875FF 0%, #699CFF 100%);
    border-radius: 2px;
    height: 32px;
    text-align: center;
    color: #fff;
    width: 84px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
  }
  .btn1-img,.btn2-img,.btn3-img{
    width: 16px;
    height: 16px;
    background-size: cover;
  }
  .btn1-img{
    background-image: url("@/assets/images/b1ab2bf6fd2dd021b78ba0856314bd67.png");
  }
  .btn2-img{
    background-image: url("@/assets/images/0f87932c7312b3e799cf894ba39c04f1.png");
  }
  .btn3-img{
    background-image: url("@/assets/images/4daefebe7bd90f1aa160c27af6bc80f0.png");
  }
  /*培训考试*/
  .px-default-table:deep(.@{ant-prefix}-table-thead) > tr > th {
    background-color: #3875ff;
    color: #fff;
    font-weight: 600;
    padding: 8px 16px;
    border-right: 1px solid #d9d9d9;
  }
  .px-default-table:deep(.@{ant-prefix}-table-tbody) tr > td {
    font-size: 14px;
    font-family: arial, helvetica, 'microsoft yahei';
    font-weight: 400;
    color: #262626;
    padding: 8px 8px;
    border-bottom: 1px solid #d9d9d9;
    word-break: break-all;
  }
  .total-msg{
    word-wrap: break-word; /* 强制换行 */
    overflow-wrap: break-word; /* 支持较旧浏览器 */
    white-space: pre-wrap; /* 保持换行符 */
  }
  /*培训考试*/
</style>